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

feat: database creation

This commit is contained in:
2020-09-25 12:39:58 +02:00
parent c1cdd03938
commit 3d0a83f2cf
12 changed files with 311 additions and 73 deletions

View File

@ -31,9 +31,44 @@ export class MySQLClient extends AntaresCore {
return this.raw(sql);
}
getCollations () {
/**
* SHOW COLLATION
*
* @returns
* @memberof MySQLClient
*/
async getCollations () {
const sql = 'SHOW COLLATION';
return this.raw(sql);
const results = await this.raw(sql);
return results.rows.map(row => {
return {
charset: row.Charset,
collation: row.Collation,
compiled: row.Compiled.includes('Yes'),
default: row.Default.includes('Yes'),
id: row.Id,
sortLen: row.Sortlen
};
});
}
/**
* SHOW VARIABLES
*
* @returns
* @memberof MySQLClient
*/
async getVariables () {
const sql = 'SHOW VARIABLES';
const results = await this.raw(sql);
return results.rows.map(row => {
return {
name: row.Variable_name,
value: row.Value
};
});
}
/**