@mikro-orm/sql 7.2.7-dev.11 → 7.2.7-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.
@@ -8,6 +8,7 @@ export declare class SqliteSchemaHelper extends SchemaHelper {
8
8
  private static readonly PARTIAL_WHERE_RE;
9
9
  disableForeignKeysSQL(): string;
10
10
  enableForeignKeysSQL(): string;
11
+ getForeignKeyCheckSQL(): string;
11
12
  supportsSchemaConstraints(): boolean;
12
13
  getCreateNamespaceSQL(name: string): string;
13
14
  getDropNamespaceSQL(name: string): string;
@@ -22,6 +22,9 @@ export class SqliteSchemaHelper extends SchemaHelper {
22
22
  enableForeignKeysSQL() {
23
23
  return 'pragma foreign_keys = on;';
24
24
  }
25
+ getForeignKeyCheckSQL() {
26
+ return 'pragma foreign_key_check';
27
+ }
25
28
  supportsSchemaConstraints() {
26
29
  return false;
27
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/sql",
3
- "version": "7.2.7-dev.11",
3
+ "version": "7.2.7-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.6"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.7-dev.11"
56
+ "@mikro-orm/core": "7.2.7-dev.13"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"
@@ -2016,7 +2016,7 @@ export class QueryBuilder {
2016
2016
  this.processNestedJoins();
2017
2017
  if (meta && (this.#state.fields?.includes('*') || this.#state.fields?.includes(`${this.mainAlias.aliasName}.*`))) {
2018
2018
  const schema = this.getSchema(this.mainAlias);
2019
- // Create a column mapping with unquoted aliases - quoting should be handled by the user via `quote` helper
2019
+ // Per-column entries are unquoted (meant for `quote`), while `toString()` yields the quoted alias for plain template literals
2020
2020
  // For TPT, use helper to resolve correct alias per property (inherited props use parent alias)
2021
2021
  const quotedMainAlias = this.platform.quoteIdentifier(this.mainAlias.aliasName).toString();
2022
2022
  const columns = meta.createColumnMappingObject(prop => this.helper.getTPTAliasForProperty(prop.name, this.mainAlias.aliasName), quotedMainAlias);
@@ -33,6 +33,8 @@ export declare abstract class SchemaHelper {
33
33
  disableForeignKeysSQL(): string;
34
34
  /** Returns SQL to re-enable foreign key checks. */
35
35
  enableForeignKeysSQL(): string;
36
+ /** Returns SQL listing rows that violate foreign keys; when non-empty, migrations run with FK checks off and verify afterwards (SQLite). */
37
+ getForeignKeyCheckSQL(): string;
36
38
  /** Returns SQL to append to schema migration scripts (e.g., re-enabling FK checks). */
37
39
  getSchemaEnd(disableForeignKeys?: boolean): string;
38
40
  /** Sets the current schema for the session (e.g. `SET search_path`). */
@@ -52,6 +52,10 @@ export class SchemaHelper {
52
52
  enableForeignKeysSQL() {
53
53
  return '';
54
54
  }
55
+ /** Returns SQL listing rows that violate foreign keys; when non-empty, migrations run with FK checks off and verify afterwards (SQLite). */
56
+ getForeignKeyCheckSQL() {
57
+ return '';
58
+ }
55
59
  /** Returns SQL to append to schema migration scripts (e.g., re-enabling FK checks). */
56
60
  getSchemaEnd(disableForeignKeys) {
57
61
  if (disableForeignKeys) {