@mikro-orm/sql 7.0.3-dev.8 → 7.0.3

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.
Files changed (87) hide show
  1. package/AbstractSqlConnection.d.ts +94 -58
  2. package/AbstractSqlConnection.js +235 -238
  3. package/AbstractSqlDriver.d.ts +410 -155
  4. package/AbstractSqlDriver.js +2064 -1937
  5. package/AbstractSqlPlatform.d.ts +83 -73
  6. package/AbstractSqlPlatform.js +162 -158
  7. package/PivotCollectionPersister.d.ts +33 -15
  8. package/PivotCollectionPersister.js +158 -160
  9. package/README.md +2 -2
  10. package/SqlEntityManager.d.ts +67 -22
  11. package/SqlEntityManager.js +54 -38
  12. package/SqlEntityRepository.d.ts +14 -14
  13. package/SqlEntityRepository.js +23 -23
  14. package/dialects/mssql/MsSqlNativeQueryBuilder.d.ts +12 -12
  15. package/dialects/mssql/MsSqlNativeQueryBuilder.js +192 -194
  16. package/dialects/mysql/BaseMySqlPlatform.d.ts +64 -45
  17. package/dialects/mysql/BaseMySqlPlatform.js +134 -131
  18. package/dialects/mysql/MySqlExceptionConverter.d.ts +6 -6
  19. package/dialects/mysql/MySqlExceptionConverter.js +91 -77
  20. package/dialects/mysql/MySqlNativeQueryBuilder.d.ts +3 -3
  21. package/dialects/mysql/MySqlNativeQueryBuilder.js +66 -69
  22. package/dialects/mysql/MySqlSchemaHelper.d.ts +39 -39
  23. package/dialects/mysql/MySqlSchemaHelper.js +327 -319
  24. package/dialects/oracledb/OracleDialect.d.ts +81 -52
  25. package/dialects/oracledb/OracleDialect.js +155 -149
  26. package/dialects/oracledb/OracleNativeQueryBuilder.d.ts +12 -12
  27. package/dialects/oracledb/OracleNativeQueryBuilder.js +232 -236
  28. package/dialects/postgresql/BasePostgreSqlPlatform.d.ts +108 -105
  29. package/dialects/postgresql/BasePostgreSqlPlatform.js +351 -350
  30. package/dialects/postgresql/FullTextType.d.ts +10 -6
  31. package/dialects/postgresql/FullTextType.js +51 -51
  32. package/dialects/postgresql/PostgreSqlExceptionConverter.d.ts +5 -5
  33. package/dialects/postgresql/PostgreSqlExceptionConverter.js +55 -43
  34. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.d.ts +1 -1
  35. package/dialects/postgresql/PostgreSqlNativeQueryBuilder.js +4 -4
  36. package/dialects/postgresql/PostgreSqlSchemaHelper.d.ts +102 -82
  37. package/dialects/postgresql/PostgreSqlSchemaHelper.js +733 -683
  38. package/dialects/sqlite/BaseSqliteConnection.d.ts +3 -5
  39. package/dialects/sqlite/BaseSqliteConnection.js +21 -19
  40. package/dialects/sqlite/NodeSqliteDialect.d.ts +1 -1
  41. package/dialects/sqlite/NodeSqliteDialect.js +23 -23
  42. package/dialects/sqlite/SqliteDriver.d.ts +1 -1
  43. package/dialects/sqlite/SqliteDriver.js +3 -3
  44. package/dialects/sqlite/SqliteExceptionConverter.d.ts +6 -6
  45. package/dialects/sqlite/SqliteExceptionConverter.js +67 -51
  46. package/dialects/sqlite/SqliteNativeQueryBuilder.d.ts +2 -2
  47. package/dialects/sqlite/SqliteNativeQueryBuilder.js +7 -7
  48. package/dialects/sqlite/SqlitePlatform.d.ts +63 -72
  49. package/dialects/sqlite/SqlitePlatform.js +139 -139
  50. package/dialects/sqlite/SqliteSchemaHelper.d.ts +70 -60
  51. package/dialects/sqlite/SqliteSchemaHelper.js +533 -520
  52. package/package.json +3 -3
  53. package/plugin/index.d.ts +42 -35
  54. package/plugin/index.js +43 -36
  55. package/plugin/transformer.d.ts +117 -94
  56. package/plugin/transformer.js +890 -881
  57. package/query/ArrayCriteriaNode.d.ts +4 -4
  58. package/query/ArrayCriteriaNode.js +18 -18
  59. package/query/CriteriaNode.d.ts +35 -25
  60. package/query/CriteriaNode.js +133 -123
  61. package/query/CriteriaNodeFactory.d.ts +49 -6
  62. package/query/CriteriaNodeFactory.js +97 -94
  63. package/query/NativeQueryBuilder.d.ts +118 -118
  64. package/query/NativeQueryBuilder.js +484 -480
  65. package/query/ObjectCriteriaNode.d.ts +12 -12
  66. package/query/ObjectCriteriaNode.js +298 -282
  67. package/query/QueryBuilder.d.ts +1546 -904
  68. package/query/QueryBuilder.js +2294 -2144
  69. package/query/QueryBuilderHelper.d.ts +153 -72
  70. package/query/QueryBuilderHelper.js +1079 -1028
  71. package/query/ScalarCriteriaNode.d.ts +3 -3
  72. package/query/ScalarCriteriaNode.js +53 -46
  73. package/query/enums.d.ts +14 -14
  74. package/query/enums.js +14 -14
  75. package/query/raw.d.ts +16 -6
  76. package/query/raw.js +10 -10
  77. package/schema/DatabaseSchema.d.ts +73 -50
  78. package/schema/DatabaseSchema.js +331 -307
  79. package/schema/DatabaseTable.d.ts +96 -73
  80. package/schema/DatabaseTable.js +1012 -927
  81. package/schema/SchemaComparator.d.ts +70 -66
  82. package/schema/SchemaComparator.js +766 -740
  83. package/schema/SchemaHelper.d.ts +109 -95
  84. package/schema/SchemaHelper.js +675 -659
  85. package/schema/SqlSchemaGenerator.d.ts +78 -58
  86. package/schema/SqlSchemaGenerator.js +535 -501
  87. package/typings.d.ts +380 -266
@@ -7,70 +7,74 @@ import type { AbstractSqlPlatform } from '../AbstractSqlPlatform.js';
7
7
  * Compares two Schemas and return an instance of SchemaDifference.
8
8
  */
9
9
  export declare class SchemaComparator {
10
- #private;
11
- constructor(platform: AbstractSqlPlatform);
12
- /**
13
- * Returns a SchemaDifference object containing the differences between the schemas fromSchema and toSchema.
14
- *
15
- * The returned differences are returned in such a way that they contain the
16
- * operations to change the schema stored in fromSchema to the schema that is
17
- * stored in toSchema.
18
- */
19
- compare(fromSchema: DatabaseSchema, toSchema: DatabaseSchema, inverseDiff?: SchemaDifference): SchemaDifference;
20
- /**
21
- * Returns the difference between the tables fromTable and toTable.
22
- * If there are no differences this method returns the boolean false.
23
- */
24
- diffTable(fromTable: DatabaseTable, toTable: DatabaseTable, inverseTableDiff?: TableDifference): TableDifference | false;
25
- /**
26
- * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
27
- * however ambiguities between different possibilities should not lead to renaming at all.
28
- */
29
- private detectColumnRenamings;
30
- /**
31
- * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop
32
- * however ambiguities between different possibilities should not lead to renaming at all.
33
- */
34
- private detectIndexRenamings;
35
- diffForeignKey(key1: ForeignKey, key2: ForeignKey, tableDifferences: TableDifference): boolean;
36
- /**
37
- * Returns the difference between the columns
38
- */
39
- diffColumn(fromColumn: Column, toColumn: Column, fromTable: DatabaseTable, logging?: boolean): Set<string>;
40
- diffEnumItems(items1?: string[], items2?: string[]): boolean;
41
- diffComment(comment1?: string, comment2?: string): boolean;
42
- /**
43
- * Finds the difference between the indexes index1 and index2.
44
- * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
45
- */
46
- diffIndex(index1: IndexDef, index2: IndexDef): boolean;
47
- /**
48
- * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
49
- */
50
- isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean;
51
- /**
52
- * Compare advanced column options between two indexes.
53
- */
54
- private compareIndexColumns;
55
- /**
56
- * Compare two arrays for equality (order matters).
57
- */
58
- private compareArrays;
59
- diffExpression(expr1: string, expr2: string): boolean;
60
- /**
61
- * Compares two view expressions, with special handling for SELECT *.
62
- * Databases like PostgreSQL and MySQL expand `SELECT *` to explicit column names
63
- * in their stored view definitions, which makes diffExpression always detect changes.
64
- * When SELECT * is present, we strip the first SELECT...FROM column list from both
65
- * sides and compare only the structural parts (FROM clause onwards).
66
- * Note: this means changes *within* subqueries in the SELECT list of a SELECT * view
67
- * may not be detected an acceptable tradeoff since SELECT * views are inherently
68
- * column-list-agnostic.
69
- * @see https://github.com/mikro-orm/mikro-orm/issues/7308
70
- */
71
- private diffViewExpression;
72
- parseJsonDefault(defaultValue?: string | null): Dictionary | string | null;
73
- hasSameDefaultValue(from: Column, to: Column): boolean;
74
- private mapColumnToProperty;
75
- private log;
10
+ #private;
11
+ constructor(platform: AbstractSqlPlatform);
12
+ /**
13
+ * Returns a SchemaDifference object containing the differences between the schemas fromSchema and toSchema.
14
+ *
15
+ * The returned differences are returned in such a way that they contain the
16
+ * operations to change the schema stored in fromSchema to the schema that is
17
+ * stored in toSchema.
18
+ */
19
+ compare(fromSchema: DatabaseSchema, toSchema: DatabaseSchema, inverseDiff?: SchemaDifference): SchemaDifference;
20
+ /**
21
+ * Returns the difference between the tables fromTable and toTable.
22
+ * If there are no differences this method returns the boolean false.
23
+ */
24
+ diffTable(
25
+ fromTable: DatabaseTable,
26
+ toTable: DatabaseTable,
27
+ inverseTableDiff?: TableDifference,
28
+ ): TableDifference | false;
29
+ /**
30
+ * Try to find columns that only changed their name, rename operations maybe cheaper than add/drop
31
+ * however ambiguities between different possibilities should not lead to renaming at all.
32
+ */
33
+ private detectColumnRenamings;
34
+ /**
35
+ * Try to find indexes that only changed their name, rename operations maybe cheaper than add/drop
36
+ * however ambiguities between different possibilities should not lead to renaming at all.
37
+ */
38
+ private detectIndexRenamings;
39
+ diffForeignKey(key1: ForeignKey, key2: ForeignKey, tableDifferences: TableDifference): boolean;
40
+ /**
41
+ * Returns the difference between the columns
42
+ */
43
+ diffColumn(fromColumn: Column, toColumn: Column, fromTable: DatabaseTable, logging?: boolean): Set<string>;
44
+ diffEnumItems(items1?: string[], items2?: string[]): boolean;
45
+ diffComment(comment1?: string, comment2?: string): boolean;
46
+ /**
47
+ * Finds the difference between the indexes index1 and index2.
48
+ * Compares index1 with index2 and returns index2 if there are any differences or false in case there are no differences.
49
+ */
50
+ diffIndex(index1: IndexDef, index2: IndexDef): boolean;
51
+ /**
52
+ * Checks if the other index already fulfills all the indexing and constraint needs of the current one.
53
+ */
54
+ isIndexFulfilledBy(index1: IndexDef, index2: IndexDef): boolean;
55
+ /**
56
+ * Compare advanced column options between two indexes.
57
+ */
58
+ private compareIndexColumns;
59
+ /**
60
+ * Compare two arrays for equality (order matters).
61
+ */
62
+ private compareArrays;
63
+ diffExpression(expr1: string, expr2: string): boolean;
64
+ /**
65
+ * Compares two view expressions, with special handling for SELECT *.
66
+ * Databases like PostgreSQL and MySQL expand `SELECT *` to explicit column names
67
+ * in their stored view definitions, which makes diffExpression always detect changes.
68
+ * When SELECT * is present, we strip the first SELECT...FROM column list from both
69
+ * sides and compare only the structural parts (FROM clause onwards).
70
+ * Note: this means changes *within* subqueries in the SELECT list of a SELECT * view
71
+ * may not be detected — an acceptable tradeoff since SELECT * views are inherently
72
+ * column-list-agnostic.
73
+ * @see https://github.com/mikro-orm/mikro-orm/issues/7308
74
+ */
75
+ private diffViewExpression;
76
+ parseJsonDefault(defaultValue?: string | null): Dictionary | string | null;
77
+ hasSameDefaultValue(from: Column, to: Column): boolean;
78
+ private mapColumnToProperty;
79
+ private log;
76
80
  }