mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 21:55:59 +00:00
refactor: move sqlite queries to sql directory
This commit is contained in:
8
plugins/dbgate-plugin-sqlite/src/backend/sql/index.js
Normal file
8
plugins/dbgate-plugin-sqlite/src/backend/sql/index.js
Normal file
@@ -0,0 +1,8 @@
|
||||
const objects = require('./objects.js');
|
||||
const objectsConditioned = require('./objectsConditioned.js');
|
||||
const indexcols = require('./indexcols.js');
|
||||
module.exports = {
|
||||
objects,
|
||||
objectsConditioned,
|
||||
indexcols,
|
||||
};
|
||||
14
plugins/dbgate-plugin-sqlite/src/backend/sql/indexcols.js
Normal file
14
plugins/dbgate-plugin-sqlite/src/backend/sql/indexcols.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = `
|
||||
SELECT
|
||||
m.name as tableName,
|
||||
il.name as constraintName,
|
||||
il."unique" as isUnique,
|
||||
ii.name as columnName,
|
||||
il.origin
|
||||
FROM sqlite_schema AS m,
|
||||
pragma_index_list(m.name) AS il,
|
||||
pragma_index_info(il.name) AS ii
|
||||
WHERE m.type='table' AND il.origin <> 'pk'
|
||||
ORDER BY ii.seqno, il.name
|
||||
|
||||
`;
|
||||
3
plugins/dbgate-plugin-sqlite/src/backend/sql/objects.js
Normal file
3
plugins/dbgate-plugin-sqlite/src/backend/sql/objects.js
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = `
|
||||
select * from sqlite_master where (type='table' or type='view')
|
||||
`;
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = `
|
||||
select * from sqlite_master where (type='table' or type='view') and name =OBJECT_ID_CONDITION
|
||||
`;
|
||||
Reference in New Issue
Block a user