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,11 +1,17 @@
|
||||
'use strict';
|
||||
export default class {
|
||||
static testConnection (connection) {
|
||||
return connection.raw('SELECT 1+1');
|
||||
return connection.select('1+1').run();
|
||||
}
|
||||
|
||||
static getStructure (connection) {
|
||||
return connection.raw('SELECT * FROM information_schema.TABLES ORDER BY TABLE_SCHEMA, TABLE_NAME ASC');
|
||||
// return connection.raw('SELECT * FROM information_schema.TABLES ORDER BY TABLE_SCHEMA ASC, TABLE_NAME ASC');
|
||||
return connection
|
||||
.select('*')
|
||||
.schema('information_schema')
|
||||
.from('TABLES')
|
||||
.orderBy({ TABLE_SCHEMA: 'ASC', TABLE_NAME: 'ASC' })
|
||||
.run();
|
||||
}
|
||||
|
||||
// TODO: SELECT * FROM `information_schema`.`COLUMNS` WHERE TABLE_SCHEMA='fepcomdb' AND TABLE_NAME='macchine' ORDER BY ORDINAL_POSITION;
|
||||
|
Reference in New Issue
Block a user