forge-sql-orm 2.0.20 → 2.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -129,6 +129,7 @@ function generateDropTableStatements(tables) {
129
129
  const dropStatements = [];
130
130
  tables.forEach((tableName) => {
131
131
  dropStatements.push(`DROP TABLE IF EXISTS \`${tableName}\`;`);
132
+ dropStatements.push(`DROP SEQUENCE IF EXISTS \`${tableName}\`;`);
132
133
  });
133
134
  return dropStatements;
134
135
  }
@@ -267,6 +268,15 @@ function processNullBranches(obj) {
267
268
  }
268
269
  return allNull ? null : result;
269
270
  }
271
+ function formatLimitOffset(limitOrOffset) {
272
+ if (typeof limitOrOffset !== "number" || isNaN(limitOrOffset)) {
273
+ throw new Error("limitOrOffset must be a valid number");
274
+ }
275
+ return sql.raw(`${limitOrOffset}`);
276
+ }
277
+ function nextVal(sequenceName) {
278
+ return sql.raw(`NEXTVAL(${sequenceName})`);
279
+ }
270
280
  class ForgeSQLCrudOperations {
271
281
  forgeOperations;
272
282
  options;
@@ -1337,6 +1347,7 @@ export {
1337
1347
  forgeSystemTables,
1338
1348
  forgeTimeString,
1339
1349
  forgeTimestampString,
1350
+ formatLimitOffset,
1340
1351
  generateDropTableStatements,
1341
1352
  getHttpResponse,
1342
1353
  getPrimaryKeys,
@@ -1345,6 +1356,7 @@ export {
1345
1356
  mapSelectAllFieldsToAlias,
1346
1357
  mapSelectFieldsWithAlias,
1347
1358
  migrations,
1359
+ nextVal,
1348
1360
  parseDateTime,
1349
1361
  patchDbWithSelectAliased
1350
1362
  };