@mikro-orm/sql 7.3.0-dev.12 → 7.3.0-dev.13

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.3.0-dev.12",
3
+ "version": "7.3.0-dev.13",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.3"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.3.0-dev.12"
56
+ "@mikro-orm/core": "7.3.0-dev.13"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -59,8 +59,8 @@ export declare class SqlSchemaGenerator extends AbstractSchemaGenerator<Abstract
59
59
  }): Promise<void>;
60
60
  /** Splits the SQL on the separator, keeping the separators that fall inside a string literal. */
61
61
  private splitOutsideLiterals;
62
- /** Whether the statement has to be the first one in a query batch, e.g. `create trigger` on MSSQL. */
63
- protected startsBatch(_statement: string): boolean;
62
+ /** Whether the statement has to be the first one in a query batch, e.g. `create trigger` on MSSQL. `previous` is the line before it in the current batch. */
63
+ protected startsBatch(_statement: string, _previous: string): boolean;
64
64
  dropTableIfExists(name: string, schema?: string): Promise<void>;
65
65
  private wrapSchema;
66
66
  private append;
@@ -479,7 +479,7 @@ export class SqlSchemaGenerator extends AbstractSchemaGenerator {
479
479
  continue;
480
480
  }
481
481
  // same boundary an empty line creates, for statements that have to start their own batch
482
- if (groups[i]?.length > 0 && this.startsBatch(stmt)) {
482
+ if (groups[i]?.length > 0 && this.startsBatch(stmt, groups[i].at(-1))) {
483
483
  i++;
484
484
  }
485
485
  groups[i] ??= [];
@@ -523,8 +523,8 @@ export class SqlSchemaGenerator extends AbstractSchemaGenerator {
523
523
  }
524
524
  return parts;
525
525
  }
526
- /** Whether the statement has to be the first one in a query batch, e.g. `create trigger` on MSSQL. */
527
- startsBatch(_statement) {
526
+ /** Whether the statement has to be the first one in a query batch, e.g. `create trigger` on MSSQL. `previous` is the line before it in the current batch. */
527
+ startsBatch(_statement, _previous) {
528
528
  return false;
529
529
  }
530
530
  async dropTableIfExists(name, schema) {