Skip to content

Commit d77d153

Browse files
committed
fix: table permission
1 parent ecd2735 commit d77d153

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/apps/datasource/crud/datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table
294294
elif ds.type == "sqlServer":
295295
sql = f"""SELECT [{"], [".join(fields)}] FROM [{conf.dbSchema}].[{data.table.table_name}]
296296
{where}
297-
ORDER BY [{data.fields[0].field_name}]
297+
ORDER BY [{fields[0]}]
298298
OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY"""
299299
elif ds.type == "pg" or ds.type == "excel":
300300
sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}"
@@ -303,7 +303,7 @@ def preview(session: SessionDep, current_user: CurrentUser, id: int, data: Table
303303
elif ds.type == "oracle":
304304
sql = f"""SELECT "{'", "'.join(fields)}" FROM "{conf.dbSchema}"."{data.table.table_name}"
305305
{where}
306-
ORDER BY "{data.fields[0].field_name}"
306+
ORDER BY "{fields[0]}"
307307
OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY"""
308308
return exec_sql(ds, sql)
309309

0 commit comments

Comments
 (0)