Skip to content

Commit

Permalink
Query Editor: Fix table and database mapping (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
idastambuk committed Jan 15, 2024
1 parent 614b65b commit 6ecb6d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/SQLEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export default function SQLEditor({ query, datasource, onRunQuery, onChange }: R
const getColumns = useCallback(
async (database?: string, tableName?: string) => {
const interpolatedArgs = {
database: database ? database.replace(TABLE_MACRO, queryRef.current.table ?? '') : queryRef.current.table,
database: database ? database.replace(DATABASE_MACRO, queryRef.current.database ?? '') : queryRef.current.database,
table: tableName
? tableName.replace(DATABASE_MACRO, queryRef.current.database ?? '')
: queryRef.current.database,
? tableName.replace(TABLE_MACRO, queryRef.current.table ?? '')
: queryRef.current.table,
};
const [measures, dimensions] = await Promise.all([
datasource.postResource('measures', interpolatedArgs).catch(() => []),
Expand Down

0 comments on commit 6ecb6d2

Please sign in to comment.