mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
feat(PostgreSQL): partial postgre implementation
This commit is contained in:
@@ -404,6 +404,44 @@ export class MySQLClient extends AntaresCore {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* CREATE DATABASE
|
||||
*
|
||||
* @returns {Array.<Object>} parameters
|
||||
* @memberof MySQLClient
|
||||
*/
|
||||
async createDatabase (params) {
|
||||
return await this.raw(`CREATE DATABASE \`${params.name}\` COLLATE ${params.collation}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* ALTER DATABASE
|
||||
*
|
||||
* @returns {Array.<Object>} parameters
|
||||
* @memberof MySQLClient
|
||||
*/
|
||||
async alterDatabase (params) {
|
||||
return await this.raw(`ALTER DATABASE \`${params.name}\` COLLATE ${params.collation}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* DROP DATABASE
|
||||
*
|
||||
* @returns {Array.<Object>} parameters
|
||||
* @memberof MySQLClient
|
||||
*/
|
||||
async dropDatabase (params) {
|
||||
return await this.raw(`DROP DATABASE \`${params.database}\``);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Array.<Object>} parameters
|
||||
* @memberof MySQLClient
|
||||
*/
|
||||
async getDatabaseCollation (params) {
|
||||
return await this.raw(`SELECT \`DEFAULT_COLLATION_NAME\` FROM \`information_schema\`.\`SCHEMATA\` WHERE \`SCHEMA_NAME\`='${params.database}'`);
|
||||
}
|
||||
|
||||
/**
|
||||
* SHOW CREATE VIEW
|
||||
*
|
||||
@@ -1281,7 +1319,7 @@ export class MySQLClient extends AntaresCore {
|
||||
const response = await this.getTableColumns(paramObj);
|
||||
remappedFields = remappedFields.map(field => {
|
||||
const detailedField = response.find(f => f.name === field.name);
|
||||
if (detailedField && field.orgTable === paramObj.table && field.schema === paramObj.schema && detailedField.name === field.orgName)
|
||||
if (detailedField && field.orgTable === paramObj.table && field.schema === paramObj.schema)
|
||||
field = { ...detailedField, ...field };
|
||||
return field;
|
||||
});
|
||||
|
Reference in New Issue
Block a user