WIP Core client library and integration test framework.

@alainjobart @guoliang100 @sougou 
Includes -
* DatabaseContext as the primary entry point.
* Base classes that control routing and cursor creation.
* Sql builder constructs.
* Integration test framework.
* Simple end to end test for unsharded keyspace and table.
Next - 
* Examples and test for range-sharding.
* Failure/error cases.
* Examples with db operation decorators.

For native use of the api we want to use the 'with' construct with
ReadFromMaster. The decorators are for youtube code.
I am working on test cases with the decorator and then add
read_from_replica and write_transaction decorators as wel.

On Tue, Dec 23, 2014 at 3:22 PM, Liang <notifications@github.com> wrote:

> In py/vtdb/database_context.py
> <https://github.com/youtube/vitess/pull/269#discussion-diff-22240398>:
>
> > +      self.dc.commit()
> > +      return True
> > +
> > +    if isinstance(exc_type, dbexceptions.OperationalError):
> > +      self.dc.vtgate_connection.close()
> > +      self.dc.vtgate_connection = None
> > +    else:
> > +      if self.dc.vtgate_connection is not None:
> > +        self.dc.rollback()
> > +      if isinstance(exc_type, dbexceptions.IntegrityError):
> > +        self.dc.event_logger.integrity_error(exc_value)
> > +      else:
> > +        self.dc.event_logger.vtgatev2_exception(exc_value)
> > +
> > +
> > +def read_from_master(method):
>
> Should client use this method or ReadFromMaster class?
> I think either we could remove this, or add similar methods for
> ReadFromReplica and WriteTransaction.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/youtube/vitess/pull/269/files#r22240398>.
>