Skip to content

Commit

Permalink
fix: connection.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
hantmac committed May 5, 2023
1 parent 8c4da88 commit 80671ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions databend_sqlalchemy/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self, db_url='http://root:@localhost:8081'):
self.client = Client.from_url(db_url)

def close(self):
pass
self.client.disconnect()

def commit(self):
pass
Expand Down Expand Up @@ -166,7 +166,7 @@ def description(self):
return self._columns

def close(self):
pass
self._reset_state()

def execute(self, operation, parameters=None, is_response=True):
"""Prepare and execute a database operation (query or command). """
Expand Down
10 changes: 5 additions & 5 deletions databend_sqlalchemy/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@


def test():
cursor = connector.connect('http://root:@localhost:8081').cursor()
cursor.execute("select null as db, name as name, database as schema, if(engine = 'VIEW', 'view', 'table') as type from system.tables where database = 'default';")
conn = connector.connect("http://root:[email protected]:8000/default")
cursor = conn.cursor()
cursor.execute(
"select null as db, name as name, database as schema, if(engine = 'VIEW', 'view', 'table') as type from system.tables where database = 'default';")
# print(cursor.fetchone())
print(cursor.fetchall())
print(cursor.description)

# for i in cursor.next():
# print(i)
conn.close()


if __name__ == '__main__':
Expand Down

0 comments on commit 80671ab

Please sign in to comment.