fix broken sql completion (#6919)

This commit is contained in:
Diego Imbert
2025-10-23 13:22:00 +02:00
committed by GitHub
parent 83910c1df4
commit ff42bf87e1
+11 -5
View File
@@ -492,12 +492,18 @@
if (typeof newSchemaRes === 'string') {
const resourcePath = newSchemaRes.replace('$res:', '')
dbSchema = $dbSchemas[resourcePath]
if (lang === 'graphql' && dbSchema === undefined) {
await getDbSchemas(lang, resourcePath, $workspaceStore, $dbSchemas, (e) => {
console.error('error getting graphql db schema', e)
})
dbSchema = $dbSchemas[resourcePath]
if (dbSchema === undefined) {
if (lang === 'graphql') {
await getDbSchemas('graphql', resourcePath, $workspaceStore, $dbSchemas, (e) => {
console.error('error getting graphql db schema', e)
})
} else if (lang === 'sql') {
await getDbSchemas(scriptLang ?? '', resourcePath, $workspaceStore, $dbSchemas, (e) => {
console.error(`error getting SQL (${scriptLang}) db schema`, e)
})
}
}
dbSchema = $dbSchemas[resourcePath]
} else {
dbSchema = undefined
}