This commit is contained in:
2025-11-17 11:12:19 +01:00
parent 5fcfc4dc2c
commit 8eebe3215a
8 changed files with 31 additions and 19 deletions
@@ -5,10 +5,7 @@ export default function dbGrabUserResource<T extends {
batch: T[] | null;
single: T | null;
debug: {
queryObject: {
sql?: string;
params?: string[];
} | undefined;
queryObject: import("../../../../types").ResponseQueryObject | undefined;
error: any;
msg: string | undefined;
};
@@ -109,8 +109,9 @@ function grabPrimaryRequiredDbSchema({ userId, dbId, dbSlug }) {
// return existingSchemaInMainJSON;
// }
// }
console.log(`userSchemaDir not found!`);
console.log(`Coudln't grab Required DB Schema!`);
console.log(`userId`, userId);
console.log(`dbId`, dbId);
return undefined;
}
function findDbNameInSchemaDir({ userId, dbName, }) {
+6 -4
View File
@@ -1402,6 +1402,10 @@ export type PagePropsType = {
docsPages?: DocsLinkType[] | null;
docsPageEditURL?: string | null;
};
export type ResponseQueryObject = {
sql?: string;
params?: string[];
};
export type APIResponseObject<T extends any = any> = {
success: boolean;
payload?: T;
@@ -1411,10 +1415,8 @@ export type APIResponseObject<T extends any = any> = {
payloadThumbnailURL?: string;
error?: any;
msg?: string;
queryObject?: {
sql?: string;
params?: string[];
};
queryObject?: ResponseQueryObject;
countQueryObject?: ResponseQueryObject;
status?: number;
count?: number;
errors?: DSQLErrorObject[];
+6 -2
View File
@@ -40,7 +40,7 @@ function default_1(_a) {
dbFullName,
})
: undefined;
if (count && countQueryObject) {
if ((count || countOnly) && countQueryObject) {
connQueries.push({
query: countQueryObject.string,
values: countQueryObject.values,
@@ -81,12 +81,16 @@ function default_1(_a) {
sql: queryObject === null || queryObject === void 0 ? void 0 : queryObject.string,
params: queryObject === null || queryObject === void 0 ? void 0 : queryObject.values,
},
countQueryObject: {
sql: countQueryObject === null || countQueryObject === void 0 ? void 0 : countQueryObject.string,
params: countQueryObject === null || countQueryObject === void 0 ? void 0 : countQueryObject.values,
},
count: isSuccess
? ((_c = (_b = res[1]) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c["COUNT(*)"])
? res[1][0]["COUNT(*)"]
: ((_e = (_d = res[0]) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e["COUNT(*)"])
? res[0][0]["COUNT(*)"]
: undefined
: 0
: undefined,
};
});