mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 14:16:01 +00:00
ALTER VIEW, ALTER PROCEDURE scripts
This commit is contained in:
@@ -36,6 +36,17 @@ export default async function applyScriptTemplate(scriptTemplate, extensions, pr
|
||||
else return objectInfo.createSql;
|
||||
}
|
||||
}
|
||||
if (scriptTemplate == 'ALTER OBJECT') {
|
||||
const objectInfo = await getSqlObjectInfo(props);
|
||||
if (objectInfo) {
|
||||
const createSql =
|
||||
objectInfo.requiresFormat && objectInfo.createSql
|
||||
? sqlFormatter.format(objectInfo.createSql)
|
||||
: objectInfo.createSql || '';
|
||||
const alterPrefix = createSql.trimStart().startsWith('CREATE ') ? 'ALTER ' : 'alter ';
|
||||
return createSql.replace(/^\s*create\s+/i, alterPrefix);
|
||||
}
|
||||
}
|
||||
if (scriptTemplate == 'EXECUTE PROCEDURE') {
|
||||
const procedureInfo = await getSqlObjectInfo(props);
|
||||
const connection = await getConnectionInfo(props);
|
||||
|
||||
Reference in New Issue
Block a user