This commit is contained in:
Benjamin Toby
2025-06-04 08:43:16 +01:00
parent 1364074c2c
commit 761348de08
37 changed files with 577 additions and 140 deletions
+3 -5
View File
@@ -11,7 +11,7 @@ const ejson_1 = __importDefault(require("../../utils/ejson"));
const generate_type_definitions_1 = __importDefault(require("./generate-type-definitions"));
const path_1 = __importDefault(require("path"));
function dbSchemaToType(params) {
var _a;
var _a, _b;
let datasquirelSchema;
const defaultTableFieldsJSONFilePath = path_1.default.resolve(__dirname, "../../data/defaultFields.json");
if (params === null || params === void 0 ? void 0 : params.dbSchema) {
@@ -39,10 +39,8 @@ function dbSchemaToType(params) {
...newDefaultFields,
] });
});
const defDbName = (datasquirelSchema.dbName ||
((_a = datasquirelSchema.dbFullName) === null || _a === void 0 ? void 0 : _a.replace(/datasquirel_user_\d+_/, "")))
.toUpperCase()
.replace(/ /g, "_");
const defDbName = (_b = (datasquirelSchema.dbName ||
((_a = datasquirelSchema.dbFullName) === null || _a === void 0 ? void 0 : _a.replace(/datasquirel_user_\d+_/, "")))) === null || _b === void 0 ? void 0 : _b.toUpperCase().replace(/ /g, "_");
const schemas = dbTablesSchemas
.map((table) => (0, generate_type_definitions_1.default)({
paradigm: "TypeScript",
+4 -1
View File
@@ -24,7 +24,10 @@ function sqlGenerator({ tableName, genObject, dbFullName, count }) {
return field;
})();
let str = `${finalFieldName}=?`;
if (typeof queryObj.value == "string" ||
if (queryObj.nullValue) {
str = `${finalFieldName} IS NULL`;
}
else if (typeof queryObj.value == "string" ||
typeof queryObj.value == "number") {
const valueParsed = String(queryObj.value);
if (queryObj.equality == "LIKE") {