mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Improvements to query builder
This commit is contained in:
@ -1,7 +1,16 @@
|
||||
'use strict';
|
||||
export default class {
|
||||
static async raw (connection, query, database) {
|
||||
if (database) await connection.raw(`USE \`${database}\``);
|
||||
static async raw (connection, query, schema) {
|
||||
if (schema) await connection.raw(`USE \`${schema}\``);
|
||||
return connection.raw(query);
|
||||
}
|
||||
|
||||
static async getTableData (connection, schema, table) {
|
||||
return connection
|
||||
.select('*')
|
||||
.schema(schema)
|
||||
.from(table)
|
||||
.limit(1000)
|
||||
.run();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user