mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 09:17:06 +08:00
fix: Possible errors caused by SQL ending with a semicolon
This commit is contained in:
@@ -300,6 +300,9 @@ def get_fields(ds: CoreDatasource, table_name: str = None):
|
||||
|
||||
|
||||
def exec_sql(ds: CoreDatasource | AssistantOutDsSchema, sql: str, origin_column=False):
|
||||
while sql.endswith(';'):
|
||||
sql = sql[:-1]
|
||||
|
||||
db = DB.get_db(ds.type)
|
||||
if db.connect_type == ConnectType.sqlalchemy:
|
||||
with get_session(ds) as session:
|
||||
|
||||
Reference in New Issue
Block a user