create database - support nosql

This commit is contained in:
Jan Prochazka 2021-04-08 15:07:57 +02:00
parent 6af21b8bae
commit a5d37eb528
2 changed files with 6 additions and 1 deletions

View File

@ -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();
}

View File

@ -64,6 +64,7 @@ export interface EngineDriver {
readCollection(pool: any, options: ReadCollectionOptions): Promise<any>;
updateCollection(pool: any, changeSet: any): Promise<any>;
getCollectionUpdateScript(changeSet: any): string;
createDatabase(pool: any, name: string): Promise;
analyserClass?: any;
dumperClass?: any;