refactor: move sqlite queries to sql directory

This commit is contained in:
Nybkox
2025-01-02 11:04:53 +01:00
parent a6f0bc78d4
commit 30bbdb0f1d
5 changed files with 33 additions and 21 deletions

View 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,
};

View 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
`;

View File

@@ -0,0 +1,3 @@
module.exports = `
select * from sqlite_master where (type='table' or type='view')
`;

View File

@@ -0,0 +1,3 @@
module.exports = `
select * from sqlite_master where (type='table' or type='view') and name =OBJECT_ID_CONDITION
`;