Browse Source

proc routes (uncomplete)

pull/122/head
Zbynek Rybicka 6 years ago committed by Jeremy Nagel
parent
commit
58418fb351
  1. 1
      lib/xapi.js
  2. 18
      lib/xsql.js

1
lib/xapi.js

@ -348,6 +348,7 @@ class Xapi {
/**************** START : call stored procedures ****************/ /**************** START : call stored procedures ****************/
this.app.get('/_proc', this.asyncMiddleware(this.proc.bind(this))) this.app.get('/_proc', this.asyncMiddleware(this.proc.bind(this)))
stat.apis += 1 stat.apis += 1
const procResources = this.mysql.getProcList(true, this.config.apiPrefix)
/**************** END : call stored procedures ****************/ /**************** END : call stored procedures ****************/
let statStr = let statStr =

18
lib/xsql.js

@ -13,6 +13,7 @@ class Xsql {
this.pool = {}; this.pool = {};
this.metaDb = {}; this.metaDb = {};
this.metaDb.tables = {}; this.metaDb.tables = {};
this.metaDb.routines = {}
this.sqlConfig = sqlConfig; this.sqlConfig = sqlConfig;
this.pool = pool; this.pool = pool;
@ -49,10 +50,11 @@ class Xsql {
} }
} }
self.iterateToCacheTables(results); self.iterateToCacheTables(results)
self.iterateToCacheTablePks(results); self.iterateToCacheTablePks(results)
self.iterateToCacheTableColumns(results); self.iterateToCacheTableColumns(results)
self.iterateToCacheTableFks(results); self.iterateToCacheTableFks(results)
self.iterateToCacheRoutines(results)
// osx mysql server has limitations related to open_tables // osx mysql server has limitations related to open_tables
self.pool.query("FLUSH TABLES", [], (err, results) => { self.pool.query("FLUSH TABLES", [], (err, results) => {
@ -741,6 +743,14 @@ class Xsql {
return schemaRoutes; return schemaRoutes;
} }
getProcList() {
let procRoutes = []
for (var procName in this.metaDb.routines) {
}
return procRoutes
}
getJoinType(joinInQueryParams) { getJoinType(joinInQueryParams) {
//console.log('joinInQueryParams',joinInQueryParams); //console.log('joinInQueryParams',joinInQueryParams);

Loading…
Cancel
Save