1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: create new tables

This commit is contained in:
2020-12-03 13:00:54 +01:00
parent f8cf90a89e
commit e6602d1bfa
11 changed files with 348 additions and 18 deletions

View File

@ -306,13 +306,33 @@ export class MySQLClient extends AntaresCore {
name: row.Engine,
support: row.Support,
comment: row.Comment,
transactions: row.Trasactions,
transactions: row.Transactions,
xa: row.XA,
savepoints: row.Savepoints
savepoints: row.Savepoints,
isDefault: row.Support.includes('DEFAULT')
};
});
}
/**
* CREATE TABLE
*
* @returns {Array.<Object>} parameters
* @memberof MySQLClient
*/
async createTable (params) {
const {
name,
collation,
comment,
engine
} = params;
const sql = `CREATE TABLE \`${name}\` (\`${name}_ID\` INT NULL) COMMENT='${comment}', COLLATE='${collation}', ENGINE=${engine}`;
return await this.raw(sql);
}
/**
* ALTER TABLE
*