phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [18/30] phoenix git commit: PHOENIX-4636 Add the python PQS driver
Date Wed, 21 Mar 2018 20:14:09 GMT
http://git-wip-us.apache.org/repos/asf/phoenix/blob/35248893/python/phoenixdb/avatica/proto/requests_pb2.py
----------------------------------------------------------------------
diff --git a/python/phoenixdb/avatica/proto/requests_pb2.py b/python/phoenixdb/avatica/proto/requests_pb2.py
new file mode 100644
index 0000000..203f945
--- /dev/null
+++ b/python/phoenixdb/avatica/proto/requests_pb2.py
@@ -0,0 +1,1206 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: requests.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import common_pb2 as common__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='requests.proto',
+  package='',
+  syntax='proto3',
+  serialized_pb=_b('\n\x0erequests.proto\x1a\x0c\x63ommon.proto\"(\n\x0f\x43\x61talogsRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"0\n\x17\x44\x61tabasePropertyRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"P\n\x0eSchemasRequest\x12\x0f\n\x07\x63\x61talog\x18\x01 \x01(\t\x12\x16\n\x0eschema_pattern\x18\x02 \x01(\t\x12\x15\n\rconnection_id\x18\x03 \x01(\t\"\x95\x01\n\rTablesRequest\x12\x0f\n\x07\x63\x61talog\x18\x01 \x01(\t\x12\x16\n\x0eschema_pattern\x18\x02 \x01(\t\x12\x1a\n\x12table_name_pattern\x18\x03 \x01(\t\x12\x11\n\ttype_list\x18\x04 \x03(\t\x12\x15\n\rhas_type_list\x18\x06 \x01(\x08\x12\x15\n\rconnection_id\x18\x07 \x01(\t\"*\n\x11TableTypesRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"\x89\x01\n\x0e\x43olumnsRequest\x12\x0f\n\x07\x63\x61talog\x18\x01 \x01(\t\x12\x16\n\x0eschema_pattern\x18\x02 \x01(\t\x12\x1a\n\x12table_name_pattern\x18\x03 \x01(\t\x12\x1b\n\x13\x63olumn_name_pattern\x18\x04 \x01(\t\x12\x15\n\rconnection_id\x18\x05 \x01(\t\"(\n\x0fTypeInfoReque
 st\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"\xa1\x01\n\x18PrepareAndExecuteRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x0b\n\x03sql\x18\x02 \x01(\t\x12\x15\n\rmax_row_count\x18\x03 \x01(\x04\x12\x14\n\x0cstatement_id\x18\x04 \x01(\r\x12\x16\n\x0emax_rows_total\x18\x05 \x01(\x03\x12\x1c\n\x14\x66irst_frame_max_size\x18\x06 \x01(\x05\"c\n\x0ePrepareRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x0b\n\x03sql\x18\x02 \x01(\t\x12\x15\n\rmax_row_count\x18\x03 \x01(\x04\x12\x16\n\x0emax_rows_total\x18\x04 \x01(\x03\"\x80\x01\n\x0c\x46\x65tchRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x0e\n\x06offset\x18\x03 \x01(\x04\x12\x1b\n\x13\x66\x65tch_max_row_count\x18\x04 \x01(\r\x12\x16\n\x0e\x66rame_max_size\x18\x05 \x01(\x05\"/\n\x16\x43reateStatementRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"D\n\x15\x43loseStatementRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\"\x8b\x01\n\x15Op
 enConnectionRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12.\n\x04info\x18\x02 \x03(\x0b\x32 .OpenConnectionRequest.InfoEntry\x1a+\n\tInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x16\x43loseConnectionRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"Y\n\x15\x43onnectionSyncRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12)\n\nconn_props\x18\x02 \x01(\x0b\x32\x15.ConnectionProperties\"\xc7\x01\n\x0e\x45xecuteRequest\x12)\n\x0fstatementHandle\x18\x01 \x01(\x0b\x32\x10.StatementHandle\x12%\n\x10parameter_values\x18\x02 \x03(\x0b\x32\x0b.TypedValue\x12\'\n\x1f\x64\x65precated_first_frame_max_size\x18\x03 \x01(\x04\x12\x1c\n\x14has_parameter_values\x18\x04 \x01(\x08\x12\x1c\n\x14\x66irst_frame_max_size\x18\x05 \x01(\x05\"m\n\x12SyncResultsRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x1a\n\x05state\x18\x03 \x01(\x0b\x32\x0b.QueryState\x12\x0e\n\x06offset\x18\x04 \x01(\x04\"&\n\rCommi
 tRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"(\n\x0fRollbackRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\"b\n\x1dPrepareAndExecuteBatchRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x14\n\x0csql_commands\x18\x03 \x03(\t\"4\n\x0bUpdateBatch\x12%\n\x10parameter_values\x18\x01 \x03(\x0b\x32\x0b.TypedValue\"a\n\x13\x45xecuteBatchRequest\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x1d\n\x07updates\x18\x03 \x03(\x0b\x32\x0c.UpdateBatchB\"\n org.apache.calcite.avatica.protob\x06proto3')
+  ,
+  dependencies=[common__pb2.DESCRIPTOR,])
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+
+
+
+_CATALOGSREQUEST = _descriptor.Descriptor(
+  name='CatalogsRequest',
+  full_name='CatalogsRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CatalogsRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=32,
+  serialized_end=72,
+)
+
+
+_DATABASEPROPERTYREQUEST = _descriptor.Descriptor(
+  name='DatabasePropertyRequest',
+  full_name='DatabasePropertyRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='DatabasePropertyRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=74,
+  serialized_end=122,
+)
+
+
+_SCHEMASREQUEST = _descriptor.Descriptor(
+  name='SchemasRequest',
+  full_name='SchemasRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='catalog', full_name='SchemasRequest.catalog', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='schema_pattern', full_name='SchemasRequest.schema_pattern', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='SchemasRequest.connection_id', index=2,
+      number=3, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=124,
+  serialized_end=204,
+)
+
+
+_TABLESREQUEST = _descriptor.Descriptor(
+  name='TablesRequest',
+  full_name='TablesRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='catalog', full_name='TablesRequest.catalog', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='schema_pattern', full_name='TablesRequest.schema_pattern', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='table_name_pattern', full_name='TablesRequest.table_name_pattern', index=2,
+      number=3, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='type_list', full_name='TablesRequest.type_list', index=3,
+      number=4, type=9, cpp_type=9, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='has_type_list', full_name='TablesRequest.has_type_list', index=4,
+      number=6, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='TablesRequest.connection_id', index=5,
+      number=7, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=207,
+  serialized_end=356,
+)
+
+
+_TABLETYPESREQUEST = _descriptor.Descriptor(
+  name='TableTypesRequest',
+  full_name='TableTypesRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='TableTypesRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=358,
+  serialized_end=400,
+)
+
+
+_COLUMNSREQUEST = _descriptor.Descriptor(
+  name='ColumnsRequest',
+  full_name='ColumnsRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='catalog', full_name='ColumnsRequest.catalog', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='schema_pattern', full_name='ColumnsRequest.schema_pattern', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='table_name_pattern', full_name='ColumnsRequest.table_name_pattern', index=2,
+      number=3, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='column_name_pattern', full_name='ColumnsRequest.column_name_pattern', index=3,
+      number=4, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='ColumnsRequest.connection_id', index=4,
+      number=5, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=403,
+  serialized_end=540,
+)
+
+
+_TYPEINFOREQUEST = _descriptor.Descriptor(
+  name='TypeInfoRequest',
+  full_name='TypeInfoRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='TypeInfoRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=542,
+  serialized_end=582,
+)
+
+
+_PREPAREANDEXECUTEREQUEST = _descriptor.Descriptor(
+  name='PrepareAndExecuteRequest',
+  full_name='PrepareAndExecuteRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='PrepareAndExecuteRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='sql', full_name='PrepareAndExecuteRequest.sql', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='max_row_count', full_name='PrepareAndExecuteRequest.max_row_count', index=2,
+      number=3, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='PrepareAndExecuteRequest.statement_id', index=3,
+      number=4, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='max_rows_total', full_name='PrepareAndExecuteRequest.max_rows_total', index=4,
+      number=5, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='first_frame_max_size', full_name='PrepareAndExecuteRequest.first_frame_max_size', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=585,
+  serialized_end=746,
+)
+
+
+_PREPAREREQUEST = _descriptor.Descriptor(
+  name='PrepareRequest',
+  full_name='PrepareRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='PrepareRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='sql', full_name='PrepareRequest.sql', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='max_row_count', full_name='PrepareRequest.max_row_count', index=2,
+      number=3, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='max_rows_total', full_name='PrepareRequest.max_rows_total', index=3,
+      number=4, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=748,
+  serialized_end=847,
+)
+
+
+_FETCHREQUEST = _descriptor.Descriptor(
+  name='FetchRequest',
+  full_name='FetchRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='FetchRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='FetchRequest.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='offset', full_name='FetchRequest.offset', index=2,
+      number=3, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='fetch_max_row_count', full_name='FetchRequest.fetch_max_row_count', index=3,
+      number=4, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='frame_max_size', full_name='FetchRequest.frame_max_size', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=850,
+  serialized_end=978,
+)
+
+
+_CREATESTATEMENTREQUEST = _descriptor.Descriptor(
+  name='CreateStatementRequest',
+  full_name='CreateStatementRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CreateStatementRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=980,
+  serialized_end=1027,
+)
+
+
+_CLOSESTATEMENTREQUEST = _descriptor.Descriptor(
+  name='CloseStatementRequest',
+  full_name='CloseStatementRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CloseStatementRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='CloseStatementRequest.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1029,
+  serialized_end=1097,
+)
+
+
+_OPENCONNECTIONREQUEST_INFOENTRY = _descriptor.Descriptor(
+  name='InfoEntry',
+  full_name='OpenConnectionRequest.InfoEntry',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='key', full_name='OpenConnectionRequest.InfoEntry.key', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='value', full_name='OpenConnectionRequest.InfoEntry.value', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=_descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001')),
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1196,
+  serialized_end=1239,
+)
+
+_OPENCONNECTIONREQUEST = _descriptor.Descriptor(
+  name='OpenConnectionRequest',
+  full_name='OpenConnectionRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='OpenConnectionRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='info', full_name='OpenConnectionRequest.info', index=1,
+      number=2, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[_OPENCONNECTIONREQUEST_INFOENTRY, ],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1100,
+  serialized_end=1239,
+)
+
+
+_CLOSECONNECTIONREQUEST = _descriptor.Descriptor(
+  name='CloseConnectionRequest',
+  full_name='CloseConnectionRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CloseConnectionRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1241,
+  serialized_end=1288,
+)
+
+
+_CONNECTIONSYNCREQUEST = _descriptor.Descriptor(
+  name='ConnectionSyncRequest',
+  full_name='ConnectionSyncRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='ConnectionSyncRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='conn_props', full_name='ConnectionSyncRequest.conn_props', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1290,
+  serialized_end=1379,
+)
+
+
+_EXECUTEREQUEST = _descriptor.Descriptor(
+  name='ExecuteRequest',
+  full_name='ExecuteRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='statementHandle', full_name='ExecuteRequest.statementHandle', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='parameter_values', full_name='ExecuteRequest.parameter_values', index=1,
+      number=2, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='deprecated_first_frame_max_size', full_name='ExecuteRequest.deprecated_first_frame_max_size', index=2,
+      number=3, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='has_parameter_values', full_name='ExecuteRequest.has_parameter_values', index=3,
+      number=4, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='first_frame_max_size', full_name='ExecuteRequest.first_frame_max_size', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1382,
+  serialized_end=1581,
+)
+
+
+_SYNCRESULTSREQUEST = _descriptor.Descriptor(
+  name='SyncResultsRequest',
+  full_name='SyncResultsRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='SyncResultsRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='SyncResultsRequest.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='state', full_name='SyncResultsRequest.state', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='offset', full_name='SyncResultsRequest.offset', index=3,
+      number=4, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1583,
+  serialized_end=1692,
+)
+
+
+_COMMITREQUEST = _descriptor.Descriptor(
+  name='CommitRequest',
+  full_name='CommitRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CommitRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1694,
+  serialized_end=1732,
+)
+
+
+_ROLLBACKREQUEST = _descriptor.Descriptor(
+  name='RollbackRequest',
+  full_name='RollbackRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='RollbackRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1734,
+  serialized_end=1774,
+)
+
+
+_PREPAREANDEXECUTEBATCHREQUEST = _descriptor.Descriptor(
+  name='PrepareAndExecuteBatchRequest',
+  full_name='PrepareAndExecuteBatchRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='PrepareAndExecuteBatchRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='PrepareAndExecuteBatchRequest.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='sql_commands', full_name='PrepareAndExecuteBatchRequest.sql_commands', index=2,
+      number=3, type=9, cpp_type=9, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1776,
+  serialized_end=1874,
+)
+
+
+_UPDATEBATCH = _descriptor.Descriptor(
+  name='UpdateBatch',
+  full_name='UpdateBatch',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='parameter_values', full_name='UpdateBatch.parameter_values', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1876,
+  serialized_end=1928,
+)
+
+
+_EXECUTEBATCHREQUEST = _descriptor.Descriptor(
+  name='ExecuteBatchRequest',
+  full_name='ExecuteBatchRequest',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='ExecuteBatchRequest.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='ExecuteBatchRequest.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='updates', full_name='ExecuteBatchRequest.updates', index=2,
+      number=3, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1930,
+  serialized_end=2027,
+)
+
+_OPENCONNECTIONREQUEST_INFOENTRY.containing_type = _OPENCONNECTIONREQUEST
+_OPENCONNECTIONREQUEST.fields_by_name['info'].message_type = _OPENCONNECTIONREQUEST_INFOENTRY
+_CONNECTIONSYNCREQUEST.fields_by_name['conn_props'].message_type = common__pb2._CONNECTIONPROPERTIES
+_EXECUTEREQUEST.fields_by_name['statementHandle'].message_type = common__pb2._STATEMENTHANDLE
+_EXECUTEREQUEST.fields_by_name['parameter_values'].message_type = common__pb2._TYPEDVALUE
+_SYNCRESULTSREQUEST.fields_by_name['state'].message_type = common__pb2._QUERYSTATE
+_UPDATEBATCH.fields_by_name['parameter_values'].message_type = common__pb2._TYPEDVALUE
+_EXECUTEBATCHREQUEST.fields_by_name['updates'].message_type = _UPDATEBATCH
+DESCRIPTOR.message_types_by_name['CatalogsRequest'] = _CATALOGSREQUEST
+DESCRIPTOR.message_types_by_name['DatabasePropertyRequest'] = _DATABASEPROPERTYREQUEST
+DESCRIPTOR.message_types_by_name['SchemasRequest'] = _SCHEMASREQUEST
+DESCRIPTOR.message_types_by_name['TablesRequest'] = _TABLESREQUEST
+DESCRIPTOR.message_types_by_name['TableTypesRequest'] = _TABLETYPESREQUEST
+DESCRIPTOR.message_types_by_name['ColumnsRequest'] = _COLUMNSREQUEST
+DESCRIPTOR.message_types_by_name['TypeInfoRequest'] = _TYPEINFOREQUEST
+DESCRIPTOR.message_types_by_name['PrepareAndExecuteRequest'] = _PREPAREANDEXECUTEREQUEST
+DESCRIPTOR.message_types_by_name['PrepareRequest'] = _PREPAREREQUEST
+DESCRIPTOR.message_types_by_name['FetchRequest'] = _FETCHREQUEST
+DESCRIPTOR.message_types_by_name['CreateStatementRequest'] = _CREATESTATEMENTREQUEST
+DESCRIPTOR.message_types_by_name['CloseStatementRequest'] = _CLOSESTATEMENTREQUEST
+DESCRIPTOR.message_types_by_name['OpenConnectionRequest'] = _OPENCONNECTIONREQUEST
+DESCRIPTOR.message_types_by_name['CloseConnectionRequest'] = _CLOSECONNECTIONREQUEST
+DESCRIPTOR.message_types_by_name['ConnectionSyncRequest'] = _CONNECTIONSYNCREQUEST
+DESCRIPTOR.message_types_by_name['ExecuteRequest'] = _EXECUTEREQUEST
+DESCRIPTOR.message_types_by_name['SyncResultsRequest'] = _SYNCRESULTSREQUEST
+DESCRIPTOR.message_types_by_name['CommitRequest'] = _COMMITREQUEST
+DESCRIPTOR.message_types_by_name['RollbackRequest'] = _ROLLBACKREQUEST
+DESCRIPTOR.message_types_by_name['PrepareAndExecuteBatchRequest'] = _PREPAREANDEXECUTEBATCHREQUEST
+DESCRIPTOR.message_types_by_name['UpdateBatch'] = _UPDATEBATCH
+DESCRIPTOR.message_types_by_name['ExecuteBatchRequest'] = _EXECUTEBATCHREQUEST
+
+CatalogsRequest = _reflection.GeneratedProtocolMessageType('CatalogsRequest', (_message.Message,), dict(
+  DESCRIPTOR = _CATALOGSREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:CatalogsRequest)
+  ))
+_sym_db.RegisterMessage(CatalogsRequest)
+
+DatabasePropertyRequest = _reflection.GeneratedProtocolMessageType('DatabasePropertyRequest', (_message.Message,), dict(
+  DESCRIPTOR = _DATABASEPROPERTYREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:DatabasePropertyRequest)
+  ))
+_sym_db.RegisterMessage(DatabasePropertyRequest)
+
+SchemasRequest = _reflection.GeneratedProtocolMessageType('SchemasRequest', (_message.Message,), dict(
+  DESCRIPTOR = _SCHEMASREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:SchemasRequest)
+  ))
+_sym_db.RegisterMessage(SchemasRequest)
+
+TablesRequest = _reflection.GeneratedProtocolMessageType('TablesRequest', (_message.Message,), dict(
+  DESCRIPTOR = _TABLESREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:TablesRequest)
+  ))
+_sym_db.RegisterMessage(TablesRequest)
+
+TableTypesRequest = _reflection.GeneratedProtocolMessageType('TableTypesRequest', (_message.Message,), dict(
+  DESCRIPTOR = _TABLETYPESREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:TableTypesRequest)
+  ))
+_sym_db.RegisterMessage(TableTypesRequest)
+
+ColumnsRequest = _reflection.GeneratedProtocolMessageType('ColumnsRequest', (_message.Message,), dict(
+  DESCRIPTOR = _COLUMNSREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:ColumnsRequest)
+  ))
+_sym_db.RegisterMessage(ColumnsRequest)
+
+TypeInfoRequest = _reflection.GeneratedProtocolMessageType('TypeInfoRequest', (_message.Message,), dict(
+  DESCRIPTOR = _TYPEINFOREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:TypeInfoRequest)
+  ))
+_sym_db.RegisterMessage(TypeInfoRequest)
+
+PrepareAndExecuteRequest = _reflection.GeneratedProtocolMessageType('PrepareAndExecuteRequest', (_message.Message,), dict(
+  DESCRIPTOR = _PREPAREANDEXECUTEREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:PrepareAndExecuteRequest)
+  ))
+_sym_db.RegisterMessage(PrepareAndExecuteRequest)
+
+PrepareRequest = _reflection.GeneratedProtocolMessageType('PrepareRequest', (_message.Message,), dict(
+  DESCRIPTOR = _PREPAREREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:PrepareRequest)
+  ))
+_sym_db.RegisterMessage(PrepareRequest)
+
+FetchRequest = _reflection.GeneratedProtocolMessageType('FetchRequest', (_message.Message,), dict(
+  DESCRIPTOR = _FETCHREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:FetchRequest)
+  ))
+_sym_db.RegisterMessage(FetchRequest)
+
+CreateStatementRequest = _reflection.GeneratedProtocolMessageType('CreateStatementRequest', (_message.Message,), dict(
+  DESCRIPTOR = _CREATESTATEMENTREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:CreateStatementRequest)
+  ))
+_sym_db.RegisterMessage(CreateStatementRequest)
+
+CloseStatementRequest = _reflection.GeneratedProtocolMessageType('CloseStatementRequest', (_message.Message,), dict(
+  DESCRIPTOR = _CLOSESTATEMENTREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:CloseStatementRequest)
+  ))
+_sym_db.RegisterMessage(CloseStatementRequest)
+
+OpenConnectionRequest = _reflection.GeneratedProtocolMessageType('OpenConnectionRequest', (_message.Message,), dict(
+
+  InfoEntry = _reflection.GeneratedProtocolMessageType('InfoEntry', (_message.Message,), dict(
+    DESCRIPTOR = _OPENCONNECTIONREQUEST_INFOENTRY,
+    __module__ = 'requests_pb2'
+    # @@protoc_insertion_point(class_scope:OpenConnectionRequest.InfoEntry)
+    ))
+  ,
+  DESCRIPTOR = _OPENCONNECTIONREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:OpenConnectionRequest)
+  ))
+_sym_db.RegisterMessage(OpenConnectionRequest)
+_sym_db.RegisterMessage(OpenConnectionRequest.InfoEntry)
+
+CloseConnectionRequest = _reflection.GeneratedProtocolMessageType('CloseConnectionRequest', (_message.Message,), dict(
+  DESCRIPTOR = _CLOSECONNECTIONREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:CloseConnectionRequest)
+  ))
+_sym_db.RegisterMessage(CloseConnectionRequest)
+
+ConnectionSyncRequest = _reflection.GeneratedProtocolMessageType('ConnectionSyncRequest', (_message.Message,), dict(
+  DESCRIPTOR = _CONNECTIONSYNCREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:ConnectionSyncRequest)
+  ))
+_sym_db.RegisterMessage(ConnectionSyncRequest)
+
+ExecuteRequest = _reflection.GeneratedProtocolMessageType('ExecuteRequest', (_message.Message,), dict(
+  DESCRIPTOR = _EXECUTEREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:ExecuteRequest)
+  ))
+_sym_db.RegisterMessage(ExecuteRequest)
+
+SyncResultsRequest = _reflection.GeneratedProtocolMessageType('SyncResultsRequest', (_message.Message,), dict(
+  DESCRIPTOR = _SYNCRESULTSREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:SyncResultsRequest)
+  ))
+_sym_db.RegisterMessage(SyncResultsRequest)
+
+CommitRequest = _reflection.GeneratedProtocolMessageType('CommitRequest', (_message.Message,), dict(
+  DESCRIPTOR = _COMMITREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:CommitRequest)
+  ))
+_sym_db.RegisterMessage(CommitRequest)
+
+RollbackRequest = _reflection.GeneratedProtocolMessageType('RollbackRequest', (_message.Message,), dict(
+  DESCRIPTOR = _ROLLBACKREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:RollbackRequest)
+  ))
+_sym_db.RegisterMessage(RollbackRequest)
+
+PrepareAndExecuteBatchRequest = _reflection.GeneratedProtocolMessageType('PrepareAndExecuteBatchRequest', (_message.Message,), dict(
+  DESCRIPTOR = _PREPAREANDEXECUTEBATCHREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:PrepareAndExecuteBatchRequest)
+  ))
+_sym_db.RegisterMessage(PrepareAndExecuteBatchRequest)
+
+UpdateBatch = _reflection.GeneratedProtocolMessageType('UpdateBatch', (_message.Message,), dict(
+  DESCRIPTOR = _UPDATEBATCH,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:UpdateBatch)
+  ))
+_sym_db.RegisterMessage(UpdateBatch)
+
+ExecuteBatchRequest = _reflection.GeneratedProtocolMessageType('ExecuteBatchRequest', (_message.Message,), dict(
+  DESCRIPTOR = _EXECUTEBATCHREQUEST,
+  __module__ = 'requests_pb2'
+  # @@protoc_insertion_point(class_scope:ExecuteBatchRequest)
+  ))
+_sym_db.RegisterMessage(ExecuteBatchRequest)
+
+
+DESCRIPTOR.has_options = True
+DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n org.apache.calcite.avatica.proto'))
+_OPENCONNECTIONREQUEST_INFOENTRY.has_options = True
+_OPENCONNECTIONREQUEST_INFOENTRY._options = _descriptor._ParseOptions(descriptor_pb2.MessageOptions(), _b('8\001'))
+# @@protoc_insertion_point(module_scope)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/35248893/python/phoenixdb/avatica/proto/responses_pb2.py
----------------------------------------------------------------------
diff --git a/python/phoenixdb/avatica/proto/responses_pb2.py b/python/phoenixdb/avatica/proto/responses_pb2.py
new file mode 100644
index 0000000..e0259b9
--- /dev/null
+++ b/python/phoenixdb/avatica/proto/responses_pb2.py
@@ -0,0 +1,917 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: responses.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+from google.protobuf import descriptor_pb2
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import common_pb2 as common__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='responses.proto',
+  package='',
+  syntax='proto3',
+  serialized_pb=_b('\n\x0fresponses.proto\x1a\x0c\x63ommon.proto\"\xc9\x01\n\x11ResultSetResponse\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x15\n\rown_statement\x18\x03 \x01(\x08\x12\x1d\n\tsignature\x18\x04 \x01(\x0b\x32\n.Signature\x12\x1b\n\x0b\x66irst_frame\x18\x05 \x01(\x0b\x32\x06.Frame\x12\x14\n\x0cupdate_count\x18\x06 \x01(\x04\x12\x1e\n\x08metadata\x18\x07 \x01(\x0b\x32\x0c.RpcMetadata\"q\n\x0f\x45xecuteResponse\x12#\n\x07results\x18\x01 \x03(\x0b\x32\x12.ResultSetResponse\x12\x19\n\x11missing_statement\x18\x02 \x01(\x08\x12\x1e\n\x08metadata\x18\x03 \x01(\x0b\x32\x0c.RpcMetadata\"V\n\x0fPrepareResponse\x12#\n\tstatement\x18\x01 \x01(\x0b\x32\x10.StatementHandle\x12\x1e\n\x08metadata\x18\x02 \x01(\x0b\x32\x0c.RpcMetadata\"z\n\rFetchResponse\x12\x15\n\x05\x66rame\x18\x01 \x01(\x0b\x32\x06.Frame\x12\x19\n\x11missing_statement\x18\x02 \x01(\x08\x12\x17\n\x0fmissing_results\x18\x03 \x01(\x08\x12\x1e\n\x08metadata\x18\x04 \x01(\x0b\x3
 2\x0c.RpcMetadata\"f\n\x17\x43reateStatementResponse\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x1e\n\x08metadata\x18\x03 \x01(\x0b\x32\x0c.RpcMetadata\"8\n\x16\x43loseStatementResponse\x12\x1e\n\x08metadata\x18\x01 \x01(\x0b\x32\x0c.RpcMetadata\"8\n\x16OpenConnectionResponse\x12\x1e\n\x08metadata\x18\x01 \x01(\x0b\x32\x0c.RpcMetadata\"9\n\x17\x43loseConnectionResponse\x12\x1e\n\x08metadata\x18\x01 \x01(\x0b\x32\x0c.RpcMetadata\"c\n\x16\x43onnectionSyncResponse\x12)\n\nconn_props\x18\x01 \x01(\x0b\x32\x15.ConnectionProperties\x12\x1e\n\x08metadata\x18\x02 \x01(\x0b\x32\x0c.RpcMetadata\"u\n\x17\x44\x61tabasePropertyElement\x12\x1e\n\x03key\x18\x01 \x01(\x0b\x32\x11.DatabaseProperty\x12\x1a\n\x05value\x18\x02 \x01(\x0b\x32\x0b.TypedValue\x12\x1e\n\x08metadata\x18\x03 \x01(\x0b\x32\x0c.RpcMetadata\"c\n\x18\x44\x61tabasePropertyResponse\x12\'\n\x05props\x18\x01 \x03(\x0b\x32\x18.DatabasePropertyElement\x12\x1e\n\x08metadata\x18\x02 \x01(\x0b\x
 32\x0c.RpcMetadata\"\xb6\x01\n\rErrorResponse\x12\x12\n\nexceptions\x18\x01 \x03(\t\x12\x16\n\x0ehas_exceptions\x18\x07 \x01(\x08\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12\x1b\n\x08severity\x18\x03 \x01(\x0e\x32\t.Severity\x12\x12\n\nerror_code\x18\x04 \x01(\r\x12\x11\n\tsql_state\x18\x05 \x01(\t\x12\x1e\n\x08metadata\x18\x06 \x01(\x0b\x32\x0c.RpcMetadata\"f\n\x13SyncResultsResponse\x12\x19\n\x11missing_statement\x18\x01 \x01(\x08\x12\x14\n\x0cmore_results\x18\x02 \x01(\x08\x12\x1e\n\x08metadata\x18\x03 \x01(\x0b\x32\x0c.RpcMetadata\"%\n\x0bRpcMetadata\x12\x16\n\x0eserver_address\x18\x01 \x01(\t\"\x10\n\x0e\x43ommitResponse\"\x12\n\x10RollbackResponse\"\x95\x01\n\x14\x45xecuteBatchResponse\x12\x15\n\rconnection_id\x18\x01 \x01(\t\x12\x14\n\x0cstatement_id\x18\x02 \x01(\r\x12\x15\n\rupdate_counts\x18\x03 \x03(\x04\x12\x19\n\x11missing_statement\x18\x04 \x01(\x08\x12\x1e\n\x08metadata\x18\x05 \x01(\x0b\x32\x0c.RpcMetadataB\"\n org.apache.calcite.avatica.protob\x06proto3')
+  ,
+  dependencies=[common__pb2.DESCRIPTOR,])
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+
+
+
+_RESULTSETRESPONSE = _descriptor.Descriptor(
+  name='ResultSetResponse',
+  full_name='ResultSetResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='ResultSetResponse.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='ResultSetResponse.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='own_statement', full_name='ResultSetResponse.own_statement', index=2,
+      number=3, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='signature', full_name='ResultSetResponse.signature', index=3,
+      number=4, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='first_frame', full_name='ResultSetResponse.first_frame', index=4,
+      number=5, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='update_count', full_name='ResultSetResponse.update_count', index=5,
+      number=6, type=4, cpp_type=4, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='ResultSetResponse.metadata', index=6,
+      number=7, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=34,
+  serialized_end=235,
+)
+
+
+_EXECUTERESPONSE = _descriptor.Descriptor(
+  name='ExecuteResponse',
+  full_name='ExecuteResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='results', full_name='ExecuteResponse.results', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='missing_statement', full_name='ExecuteResponse.missing_statement', index=1,
+      number=2, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='ExecuteResponse.metadata', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=237,
+  serialized_end=350,
+)
+
+
+_PREPARERESPONSE = _descriptor.Descriptor(
+  name='PrepareResponse',
+  full_name='PrepareResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='statement', full_name='PrepareResponse.statement', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='PrepareResponse.metadata', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=352,
+  serialized_end=438,
+)
+
+
+_FETCHRESPONSE = _descriptor.Descriptor(
+  name='FetchResponse',
+  full_name='FetchResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='frame', full_name='FetchResponse.frame', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='missing_statement', full_name='FetchResponse.missing_statement', index=1,
+      number=2, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='missing_results', full_name='FetchResponse.missing_results', index=2,
+      number=3, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='FetchResponse.metadata', index=3,
+      number=4, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=440,
+  serialized_end=562,
+)
+
+
+_CREATESTATEMENTRESPONSE = _descriptor.Descriptor(
+  name='CreateStatementResponse',
+  full_name='CreateStatementResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='CreateStatementResponse.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='CreateStatementResponse.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='CreateStatementResponse.metadata', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=564,
+  serialized_end=666,
+)
+
+
+_CLOSESTATEMENTRESPONSE = _descriptor.Descriptor(
+  name='CloseStatementResponse',
+  full_name='CloseStatementResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='CloseStatementResponse.metadata', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=668,
+  serialized_end=724,
+)
+
+
+_OPENCONNECTIONRESPONSE = _descriptor.Descriptor(
+  name='OpenConnectionResponse',
+  full_name='OpenConnectionResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='OpenConnectionResponse.metadata', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=726,
+  serialized_end=782,
+)
+
+
+_CLOSECONNECTIONRESPONSE = _descriptor.Descriptor(
+  name='CloseConnectionResponse',
+  full_name='CloseConnectionResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='CloseConnectionResponse.metadata', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=784,
+  serialized_end=841,
+)
+
+
+_CONNECTIONSYNCRESPONSE = _descriptor.Descriptor(
+  name='ConnectionSyncResponse',
+  full_name='ConnectionSyncResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='conn_props', full_name='ConnectionSyncResponse.conn_props', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='ConnectionSyncResponse.metadata', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=843,
+  serialized_end=942,
+)
+
+
+_DATABASEPROPERTYELEMENT = _descriptor.Descriptor(
+  name='DatabasePropertyElement',
+  full_name='DatabasePropertyElement',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='key', full_name='DatabasePropertyElement.key', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='value', full_name='DatabasePropertyElement.value', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='DatabasePropertyElement.metadata', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=944,
+  serialized_end=1061,
+)
+
+
+_DATABASEPROPERTYRESPONSE = _descriptor.Descriptor(
+  name='DatabasePropertyResponse',
+  full_name='DatabasePropertyResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='props', full_name='DatabasePropertyResponse.props', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='DatabasePropertyResponse.metadata', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1063,
+  serialized_end=1162,
+)
+
+
+_ERRORRESPONSE = _descriptor.Descriptor(
+  name='ErrorResponse',
+  full_name='ErrorResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='exceptions', full_name='ErrorResponse.exceptions', index=0,
+      number=1, type=9, cpp_type=9, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='has_exceptions', full_name='ErrorResponse.has_exceptions', index=1,
+      number=7, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='error_message', full_name='ErrorResponse.error_message', index=2,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='severity', full_name='ErrorResponse.severity', index=3,
+      number=3, type=14, cpp_type=8, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='error_code', full_name='ErrorResponse.error_code', index=4,
+      number=4, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='sql_state', full_name='ErrorResponse.sql_state', index=5,
+      number=5, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='ErrorResponse.metadata', index=6,
+      number=6, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1165,
+  serialized_end=1347,
+)
+
+
+_SYNCRESULTSRESPONSE = _descriptor.Descriptor(
+  name='SyncResultsResponse',
+  full_name='SyncResultsResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='missing_statement', full_name='SyncResultsResponse.missing_statement', index=0,
+      number=1, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='more_results', full_name='SyncResultsResponse.more_results', index=1,
+      number=2, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='SyncResultsResponse.metadata', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1349,
+  serialized_end=1451,
+)
+
+
+_RPCMETADATA = _descriptor.Descriptor(
+  name='RpcMetadata',
+  full_name='RpcMetadata',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='server_address', full_name='RpcMetadata.server_address', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1453,
+  serialized_end=1490,
+)
+
+
+_COMMITRESPONSE = _descriptor.Descriptor(
+  name='CommitResponse',
+  full_name='CommitResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1492,
+  serialized_end=1508,
+)
+
+
+_ROLLBACKRESPONSE = _descriptor.Descriptor(
+  name='RollbackResponse',
+  full_name='RollbackResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1510,
+  serialized_end=1528,
+)
+
+
+_EXECUTEBATCHRESPONSE = _descriptor.Descriptor(
+  name='ExecuteBatchResponse',
+  full_name='ExecuteBatchResponse',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='connection_id', full_name='ExecuteBatchResponse.connection_id', index=0,
+      number=1, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='statement_id', full_name='ExecuteBatchResponse.statement_id', index=1,
+      number=2, type=13, cpp_type=3, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='update_counts', full_name='ExecuteBatchResponse.update_counts', index=2,
+      number=3, type=4, cpp_type=4, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='missing_statement', full_name='ExecuteBatchResponse.missing_statement', index=3,
+      number=4, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+    _descriptor.FieldDescriptor(
+      name='metadata', full_name='ExecuteBatchResponse.metadata', index=4,
+      number=5, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      options=None),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=1531,
+  serialized_end=1680,
+)
+
+_RESULTSETRESPONSE.fields_by_name['signature'].message_type = common__pb2._SIGNATURE
+_RESULTSETRESPONSE.fields_by_name['first_frame'].message_type = common__pb2._FRAME
+_RESULTSETRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_EXECUTERESPONSE.fields_by_name['results'].message_type = _RESULTSETRESPONSE
+_EXECUTERESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_PREPARERESPONSE.fields_by_name['statement'].message_type = common__pb2._STATEMENTHANDLE
+_PREPARERESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_FETCHRESPONSE.fields_by_name['frame'].message_type = common__pb2._FRAME
+_FETCHRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_CREATESTATEMENTRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_CLOSESTATEMENTRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_OPENCONNECTIONRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_CLOSECONNECTIONRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_CONNECTIONSYNCRESPONSE.fields_by_name['conn_props'].message_type = common__pb2._CONNECTIONPROPERTIES
+_CONNECTIONSYNCRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_DATABASEPROPERTYELEMENT.fields_by_name['key'].message_type = common__pb2._DATABASEPROPERTY
+_DATABASEPROPERTYELEMENT.fields_by_name['value'].message_type = common__pb2._TYPEDVALUE
+_DATABASEPROPERTYELEMENT.fields_by_name['metadata'].message_type = _RPCMETADATA
+_DATABASEPROPERTYRESPONSE.fields_by_name['props'].message_type = _DATABASEPROPERTYELEMENT
+_DATABASEPROPERTYRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_ERRORRESPONSE.fields_by_name['severity'].enum_type = common__pb2._SEVERITY
+_ERRORRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_SYNCRESULTSRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+_EXECUTEBATCHRESPONSE.fields_by_name['metadata'].message_type = _RPCMETADATA
+DESCRIPTOR.message_types_by_name['ResultSetResponse'] = _RESULTSETRESPONSE
+DESCRIPTOR.message_types_by_name['ExecuteResponse'] = _EXECUTERESPONSE
+DESCRIPTOR.message_types_by_name['PrepareResponse'] = _PREPARERESPONSE
+DESCRIPTOR.message_types_by_name['FetchResponse'] = _FETCHRESPONSE
+DESCRIPTOR.message_types_by_name['CreateStatementResponse'] = _CREATESTATEMENTRESPONSE
+DESCRIPTOR.message_types_by_name['CloseStatementResponse'] = _CLOSESTATEMENTRESPONSE
+DESCRIPTOR.message_types_by_name['OpenConnectionResponse'] = _OPENCONNECTIONRESPONSE
+DESCRIPTOR.message_types_by_name['CloseConnectionResponse'] = _CLOSECONNECTIONRESPONSE
+DESCRIPTOR.message_types_by_name['ConnectionSyncResponse'] = _CONNECTIONSYNCRESPONSE
+DESCRIPTOR.message_types_by_name['DatabasePropertyElement'] = _DATABASEPROPERTYELEMENT
+DESCRIPTOR.message_types_by_name['DatabasePropertyResponse'] = _DATABASEPROPERTYRESPONSE
+DESCRIPTOR.message_types_by_name['ErrorResponse'] = _ERRORRESPONSE
+DESCRIPTOR.message_types_by_name['SyncResultsResponse'] = _SYNCRESULTSRESPONSE
+DESCRIPTOR.message_types_by_name['RpcMetadata'] = _RPCMETADATA
+DESCRIPTOR.message_types_by_name['CommitResponse'] = _COMMITRESPONSE
+DESCRIPTOR.message_types_by_name['RollbackResponse'] = _ROLLBACKRESPONSE
+DESCRIPTOR.message_types_by_name['ExecuteBatchResponse'] = _EXECUTEBATCHRESPONSE
+
+ResultSetResponse = _reflection.GeneratedProtocolMessageType('ResultSetResponse', (_message.Message,), dict(
+  DESCRIPTOR = _RESULTSETRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:ResultSetResponse)
+  ))
+_sym_db.RegisterMessage(ResultSetResponse)
+
+ExecuteResponse = _reflection.GeneratedProtocolMessageType('ExecuteResponse', (_message.Message,), dict(
+  DESCRIPTOR = _EXECUTERESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:ExecuteResponse)
+  ))
+_sym_db.RegisterMessage(ExecuteResponse)
+
+PrepareResponse = _reflection.GeneratedProtocolMessageType('PrepareResponse', (_message.Message,), dict(
+  DESCRIPTOR = _PREPARERESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:PrepareResponse)
+  ))
+_sym_db.RegisterMessage(PrepareResponse)
+
+FetchResponse = _reflection.GeneratedProtocolMessageType('FetchResponse', (_message.Message,), dict(
+  DESCRIPTOR = _FETCHRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:FetchResponse)
+  ))
+_sym_db.RegisterMessage(FetchResponse)
+
+CreateStatementResponse = _reflection.GeneratedProtocolMessageType('CreateStatementResponse', (_message.Message,), dict(
+  DESCRIPTOR = _CREATESTATEMENTRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:CreateStatementResponse)
+  ))
+_sym_db.RegisterMessage(CreateStatementResponse)
+
+CloseStatementResponse = _reflection.GeneratedProtocolMessageType('CloseStatementResponse', (_message.Message,), dict(
+  DESCRIPTOR = _CLOSESTATEMENTRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:CloseStatementResponse)
+  ))
+_sym_db.RegisterMessage(CloseStatementResponse)
+
+OpenConnectionResponse = _reflection.GeneratedProtocolMessageType('OpenConnectionResponse', (_message.Message,), dict(
+  DESCRIPTOR = _OPENCONNECTIONRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:OpenConnectionResponse)
+  ))
+_sym_db.RegisterMessage(OpenConnectionResponse)
+
+CloseConnectionResponse = _reflection.GeneratedProtocolMessageType('CloseConnectionResponse', (_message.Message,), dict(
+  DESCRIPTOR = _CLOSECONNECTIONRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:CloseConnectionResponse)
+  ))
+_sym_db.RegisterMessage(CloseConnectionResponse)
+
+ConnectionSyncResponse = _reflection.GeneratedProtocolMessageType('ConnectionSyncResponse', (_message.Message,), dict(
+  DESCRIPTOR = _CONNECTIONSYNCRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:ConnectionSyncResponse)
+  ))
+_sym_db.RegisterMessage(ConnectionSyncResponse)
+
+DatabasePropertyElement = _reflection.GeneratedProtocolMessageType('DatabasePropertyElement', (_message.Message,), dict(
+  DESCRIPTOR = _DATABASEPROPERTYELEMENT,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:DatabasePropertyElement)
+  ))
+_sym_db.RegisterMessage(DatabasePropertyElement)
+
+DatabasePropertyResponse = _reflection.GeneratedProtocolMessageType('DatabasePropertyResponse', (_message.Message,), dict(
+  DESCRIPTOR = _DATABASEPROPERTYRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:DatabasePropertyResponse)
+  ))
+_sym_db.RegisterMessage(DatabasePropertyResponse)
+
+ErrorResponse = _reflection.GeneratedProtocolMessageType('ErrorResponse', (_message.Message,), dict(
+  DESCRIPTOR = _ERRORRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:ErrorResponse)
+  ))
+_sym_db.RegisterMessage(ErrorResponse)
+
+SyncResultsResponse = _reflection.GeneratedProtocolMessageType('SyncResultsResponse', (_message.Message,), dict(
+  DESCRIPTOR = _SYNCRESULTSRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:SyncResultsResponse)
+  ))
+_sym_db.RegisterMessage(SyncResultsResponse)
+
+RpcMetadata = _reflection.GeneratedProtocolMessageType('RpcMetadata', (_message.Message,), dict(
+  DESCRIPTOR = _RPCMETADATA,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:RpcMetadata)
+  ))
+_sym_db.RegisterMessage(RpcMetadata)
+
+CommitResponse = _reflection.GeneratedProtocolMessageType('CommitResponse', (_message.Message,), dict(
+  DESCRIPTOR = _COMMITRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:CommitResponse)
+  ))
+_sym_db.RegisterMessage(CommitResponse)
+
+RollbackResponse = _reflection.GeneratedProtocolMessageType('RollbackResponse', (_message.Message,), dict(
+  DESCRIPTOR = _ROLLBACKRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:RollbackResponse)
+  ))
+_sym_db.RegisterMessage(RollbackResponse)
+
+ExecuteBatchResponse = _reflection.GeneratedProtocolMessageType('ExecuteBatchResponse', (_message.Message,), dict(
+  DESCRIPTOR = _EXECUTEBATCHRESPONSE,
+  __module__ = 'responses_pb2'
+  # @@protoc_insertion_point(class_scope:ExecuteBatchResponse)
+  ))
+_sym_db.RegisterMessage(ExecuteBatchResponse)
+
+
+DESCRIPTOR.has_options = True
+DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n org.apache.calcite.avatica.proto'))
+# @@protoc_insertion_point(module_scope)

http://git-wip-us.apache.org/repos/asf/phoenix/blob/35248893/python/phoenixdb/connection.py
----------------------------------------------------------------------
diff --git a/python/phoenixdb/connection.py b/python/phoenixdb/connection.py
new file mode 100644
index 0000000..593a242
--- /dev/null
+++ b/python/phoenixdb/connection.py
@@ -0,0 +1,187 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import logging
+import uuid
+import weakref
+from phoenixdb import errors
+from phoenixdb.avatica.client import OPEN_CONNECTION_PROPERTIES
+from phoenixdb.cursor import Cursor
+from phoenixdb.errors import ProgrammingError
+
+__all__ = ['Connection']
+
+logger = logging.getLogger(__name__)
+
+
+class Connection(object):
+    """Database connection.
+
+    You should not construct this object manually, use :func:`~phoenixdb.connect` instead.
+    """
+
+    cursor_factory = None
+    """
+    The default cursor factory used by :meth:`cursor` if the parameter is not specified.
+    """
+
+    def __init__(self, client, cursor_factory=None, **kwargs):
+        self._client = client
+        self._closed = False
+        if cursor_factory is not None:
+            self.cursor_factory = cursor_factory
+        else:
+            self.cursor_factory = Cursor
+        self._cursors = []
+        # Extract properties to pass to OpenConnectionRequest
+        self._connection_args = {}
+        # The rest of the kwargs
+        self._filtered_args = {}
+        for k in kwargs:
+            if k in OPEN_CONNECTION_PROPERTIES:
+                self._connection_args[k] = kwargs[k]
+            else:
+                self._filtered_args[k] = kwargs[k]
+        self.open()
+        self.set_session(**self._filtered_args)
+
+    def __del__(self):
+        if not self._closed:
+            self.close()
+
+    def __enter__(self):
+        return self
+
+    def __exit__(self, exc_type, exc_value, traceback):
+        if not self._closed:
+            self.close()
+
+    def open(self):
+        """Opens the connection."""
+        self._id = str(uuid.uuid4())
+        self._client.open_connection(self._id, info=self._connection_args)
+
+    def close(self):
+        """Closes the connection.
+        No further operations are allowed, either on the connection or any
+        of its cursors, once the connection is closed.
+
+        If the connection is used in a ``with`` statement, this method will
+        be automatically called at the end of the ``with`` block.
+        """
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+        for cursor_ref in self._cursors:
+            cursor = cursor_ref()
+            if cursor is not None and not cursor._closed:
+                cursor.close()
+        self._client.close_connection(self._id)
+        self._client.close()
+        self._closed = True
+
+    @property
+    def closed(self):
+        """Read-only attribute specifying if the connection is closed or not."""
+        return self._closed
+
+    def commit(self):
+        """Commits pending database changes.
+
+        Currently, this does nothing, because the RPC does not support
+        transactions. Only defined for DB API 2.0 compatibility.
+        You need to use :attr:`autocommit` mode.
+        """
+        # TODO can support be added for this?
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+
+    def cursor(self, cursor_factory=None):
+        """Creates a new cursor.
+
+        :param cursor_factory:
+            This argument can be used to create non-standard cursors.
+            The class returned must be a subclass of
+            :class:`~phoenixdb.cursor.Cursor` (for example :class:`~phoenixdb.cursor.DictCursor`).
+            A default factory for the connection can also be specified using the
+            :attr:`cursor_factory` attribute.
+
+        :returns:
+            A :class:`~phoenixdb.cursor.Cursor` object.
+        """
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+        cursor = (cursor_factory or self.cursor_factory)(self)
+        self._cursors.append(weakref.ref(cursor, self._cursors.remove))
+        return cursor
+
+    def set_session(self, autocommit=None, readonly=None):
+        """Sets one or more parameters in the current connection.
+
+        :param autocommit:
+            Switch the connection to autocommit mode. With the current
+            version, you need to always enable this, because
+            :meth:`commit` is not implemented.
+
+        :param readonly:
+            Switch the connection to read-only mode.
+        """
+        props = {}
+        if autocommit is not None:
+            props['autoCommit'] = bool(autocommit)
+        if readonly is not None:
+            props['readOnly'] = bool(readonly)
+        props = self._client.connection_sync(self._id, props)
+        self._autocommit = props.auto_commit
+        self._readonly = props.read_only
+        self._transactionisolation = props.transaction_isolation
+
+    @property
+    def autocommit(self):
+        """Read/write attribute for switching the connection's autocommit mode."""
+        return self._autocommit
+
+    @autocommit.setter
+    def autocommit(self, value):
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+        props = self._client.connection_sync(self._id, {'autoCommit': bool(value)})
+        self._autocommit = props.auto_commit
+
+    @property
+    def readonly(self):
+        """Read/write attribute for switching the connection's readonly mode."""
+        return self._readonly
+
+    @readonly.setter
+    def readonly(self, value):
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+        props = self._client.connection_sync(self._id, {'readOnly': bool(value)})
+        self._readonly = props.read_only
+
+    @property
+    def transactionisolation(self):
+        return self._transactionisolation
+
+    @transactionisolation.setter
+    def transactionisolation(self, value):
+        if self._closed:
+            raise ProgrammingError('the connection is already closed')
+        props = self._client.connection_sync(self._id, {'transactionIsolation': bool(value)})
+        self._transactionisolation = props.transaction_isolation
+
+
+for name in errors.__all__:
+    setattr(Connection, name, getattr(errors, name))


Mime
View raw message