Skip to content

Commit 3e4ceef

Browse files
authored
fix: should not set filters for SELECT with known context (#1666)
1 parent 0e5c356 commit 3e4ceef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/containers/Tenant/utils/schemaQueryTemplates.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,10 @@ export const selectQueryTemplate = (params?: SchemaQueryParams) => {
8888
const path = params?.relativePath ? `\`${params?.relativePath}\`` : '${2:<my_table>}';
8989
const columns =
9090
params?.tableData?.map((column) => '`' + column.name + '`').join(', ') || '${1:*}';
91-
91+
const filters = params?.relativePath ? '' : 'WHERE ${3:Key1 = 1}\nORDER BY ${4:Key1}\n';
9292
return `SELECT ${columns}
9393
FROM ${path}
94-
WHERE \${3:Key1 = 1}
95-
ORDER BY \${4:Key1}
96-
LIMIT \${5:10};`;
94+
${filters}LIMIT \${5:10};`;
9795
};
9896
export const upsertQueryTemplate = (params?: SchemaQueryParams) => {
9997
const path = params?.relativePath ? `\`${params?.relativePath}\`` : '${1:<my_table>}';

0 commit comments

Comments
 (0)