This commit is contained in:
Benjamin Toby 2026-03-08 14:23:50 +01:00
parent b583fefe89
commit 835458cc14
3 changed files with 13 additions and 5 deletions

View File

@ -21,6 +21,7 @@ function DbSelect(_a) {
return __awaiter(this, arguments, void 0, function* ({ table, query, count, targetId, }) { return __awaiter(this, arguments, void 0, function* ({ table, query, count, targetId, }) {
var _b; var _b;
let sql; let sql;
let sqlObj;
try { try {
let finalQuery = query || {}; let finalQuery = query || {};
if (targetId) { if (targetId) {
@ -32,7 +33,7 @@ function DbSelect(_a) {
}, },
}); });
} }
const sqlObj = (0, sql_generator_1.default)({ sqlObj = (0, sql_generator_1.default)({
tableName: table, tableName: table,
genObject: finalQuery, genObject: finalQuery,
count, count,
@ -60,7 +61,10 @@ function DbSelect(_a) {
return { return {
success: false, success: false,
error: error.message, error: error.message,
debug: { sql }, debug: {
sql,
sqlObj,
},
}; };
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/nsqlite", "name": "@moduletrace/nsqlite",
"version": "1.0.7", "version": "1.0.8",
"description": "SQLite manager for Node JS", "description": "SQLite manager for Node JS",
"author": "Benjamin Toby", "author": "Benjamin Toby",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -24,6 +24,7 @@ export default async function DbSelect<
targetId, targetId,
}: Params<Schema, Table>): Promise<APIResponseObject<Schema>> { }: Params<Schema, Table>): Promise<APIResponseObject<Schema>> {
let sql: string | undefined; let sql: string | undefined;
let sqlObj: any | undefined;
try { try {
let finalQuery = query || {}; let finalQuery = query || {};
@ -41,7 +42,7 @@ export default async function DbSelect<
); );
} }
const sqlObj = sqlGenerator({ sqlObj = sqlGenerator({
tableName: table, tableName: table,
genObject: finalQuery, genObject: finalQuery,
count, count,
@ -76,7 +77,10 @@ export default async function DbSelect<
return { return {
success: false, success: false,
error: error.message, error: error.message,
debug: { sql }, debug: {
sql,
sqlObj,
},
}; };
} }
} }