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:
@ -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
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user