fix: table autocomplete should pass catalog (#28413)
This commit is contained in:
parent
307ebeaa19
commit
e516bba8fc
|
|
@ -61,6 +61,7 @@ const fakeFunctionNamesApiResult = {
|
|||
};
|
||||
|
||||
const expectDbId = 1;
|
||||
const expectCatalog = null;
|
||||
const expectSchema = 'schema1';
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
@ -228,7 +229,12 @@ test('returns column keywords among selected tables', async () => {
|
|||
),
|
||||
);
|
||||
storeWithSqlLab.dispatch(
|
||||
addTable({ id: expectQueryEditorId }, expectTable, expectSchema),
|
||||
addTable(
|
||||
{ id: expectQueryEditorId },
|
||||
expectTable,
|
||||
expectCatalog,
|
||||
expectSchema,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
@ -267,7 +273,12 @@ test('returns column keywords among selected tables', async () => {
|
|||
|
||||
act(() => {
|
||||
storeWithSqlLab.dispatch(
|
||||
addTable({ id: expectQueryEditorId }, unexpectedTable, expectSchema),
|
||||
addTable(
|
||||
{ id: expectQueryEditorId },
|
||||
unexpectedTable,
|
||||
expectCatalog,
|
||||
expectSchema,
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,9 @@ export function useKeywords(
|
|||
|
||||
const insertMatch = useEffectEvent((editor: Editor, data: any) => {
|
||||
if (data.meta === 'table') {
|
||||
dispatch(addTable({ id: queryEditorId, dbId }, data.value, schema));
|
||||
dispatch(
|
||||
addTable({ id: queryEditorId, dbId }, data.value, catalog, schema),
|
||||
);
|
||||
}
|
||||
|
||||
let { caption } = data;
|
||||
|
|
|
|||
Loading…
Reference in New Issue