feat(dameng): show view validity and support recompilation
This commit is contained in:
1 parent
e4bda693fb
commit
6b81a98453
71 files changed
+1040
-38
No files matched your search
@@ -0,0 +1,16 @@
|
||||
export interface DamengCompileViewSqlInput {
|
||||
schema?: string | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function buildDamengCompileViewSql(input: DamengCompileViewSqlInput): string | null {
|
||||
const name = input.name.trim();
|
||||
if (!name) return null;
|
||||
const schema = input.schema?.trim();
|
||||
const qualifiedName = schema ? `${quoteDamengIdentifier(schema)}.${quoteDamengIdentifier(name)}` : quoteDamengIdentifier(name);
|
||||
return `ALTER VIEW ${qualifiedName} COMPILE;`;
|
||||
}
|
||||
|
||||
function quoteDamengIdentifier(value: string): string {
|
||||
return `"${value.replaceAll('"', '""')}"`;
|
||||
}
|
||||
Reference in new issue
Block a user