diff --git a/packages/api/src/proc/serverConnectionProcess.js b/packages/api/src/proc/serverConnectionProcess.js index 728f6f81..0ff79d1a 100644 --- a/packages/api/src/proc/serverConnectionProcess.js +++ b/packages/api/src/proc/serverConnectionProcess.js @@ -71,7 +71,11 @@ async function handleCreateDatabase({ name }) { const driver = requireEngineDriver(storedConnection); systemConnection = await connectUtility(driver, storedConnection); console.log(`RUNNING SCRIPT: CREATE DATABASE ${driver.dialect.quoteIdentifier(name)}`); - await driver.query(systemConnection, `CREATE DATABASE ${driver.dialect.quoteIdentifier(name)}`); + if (driver.createDatabase) { + await driver.createDatabase(systemConnection, name); + } else { + await driver.query(systemConnection, `CREATE DATABASE ${driver.dialect.quoteIdentifier(name)}`); + } await handleRefresh(); } diff --git a/packages/types/engines.d.ts b/packages/types/engines.d.ts index 8dfe8f71..fb4fa5e6 100644 --- a/packages/types/engines.d.ts +++ b/packages/types/engines.d.ts @@ -64,6 +64,7 @@ export interface EngineDriver { readCollection(pool: any, options: ReadCollectionOptions): Promise; updateCollection(pool: any, changeSet: any): Promise; getCollectionUpdateScript(changeSet: any): string; + createDatabase(pool: any, name: string): Promise; analyserClass?: any; dumperClass?: any;