@mikro-orm/knex 6.0.0-dev.4 → 6.0.0-dev.6

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 (53) hide show
  1. package/{dist/AbstractSqlConnection.d.ts → AbstractSqlConnection.d.ts} +0 -0
  2. package/{dist/AbstractSqlConnection.js → AbstractSqlConnection.js} +5 -0
  3. package/AbstractSqlDriver.d.ts +66 -0
  4. package/{dist/AbstractSqlDriver.js → AbstractSqlDriver.js} +218 -70
  5. package/{dist/AbstractSqlPlatform.d.ts → AbstractSqlPlatform.d.ts} +6 -6
  6. package/{dist/AbstractSqlPlatform.js → AbstractSqlPlatform.js} +12 -14
  7. package/{dist/MonkeyPatchable.d.ts → MonkeyPatchable.d.ts} +0 -0
  8. package/{dist/MonkeyPatchable.js → MonkeyPatchable.js} +0 -0
  9. package/{dist/README.md → README.md} +2 -2
  10. package/{dist/SqlEntityManager.d.ts → SqlEntityManager.d.ts} +5 -5
  11. package/{dist/SqlEntityManager.js → SqlEntityManager.js} +0 -1
  12. package/{dist/SqlEntityRepository.d.ts → SqlEntityRepository.d.ts} +3 -3
  13. package/{dist/SqlEntityRepository.js → SqlEntityRepository.js} +1 -1
  14. package/{dist/index.d.ts → index.d.ts} +0 -0
  15. package/{dist/index.js → index.js} +5 -1
  16. package/{dist/index.mjs → index.mjs} +0 -0
  17. package/package.json +18 -47
  18. package/{dist/query → query}/ArrayCriteriaNode.d.ts +0 -0
  19. package/{dist/query → query}/ArrayCriteriaNode.js +0 -0
  20. package/{dist/query → query}/CriteriaNode.d.ts +0 -0
  21. package/{dist/query → query}/CriteriaNode.js +7 -4
  22. package/{dist/query → query}/CriteriaNodeFactory.d.ts +0 -0
  23. package/{dist/query → query}/CriteriaNodeFactory.js +0 -0
  24. package/{dist/query → query}/ObjectCriteriaNode.d.ts +0 -0
  25. package/{dist/query → query}/ObjectCriteriaNode.js +14 -1
  26. package/{dist/query → query}/QueryBuilder.d.ts +58 -24
  27. package/{dist/query → query}/QueryBuilder.js +285 -84
  28. package/{dist/query → query}/QueryBuilderHelper.d.ts +19 -11
  29. package/{dist/query → query}/QueryBuilderHelper.js +206 -108
  30. package/{dist/query → query}/ScalarCriteriaNode.d.ts +0 -0
  31. package/{dist/query → query}/ScalarCriteriaNode.js +0 -0
  32. package/{dist/query → query}/enums.d.ts +0 -0
  33. package/{dist/query → query}/enums.js +0 -0
  34. package/{dist/query → query}/index.d.ts +0 -0
  35. package/{dist/query → query}/index.js +5 -1
  36. package/{dist/schema → schema}/DatabaseSchema.d.ts +1 -1
  37. package/{dist/schema → schema}/DatabaseSchema.js +8 -16
  38. package/{dist/schema → schema}/DatabaseTable.d.ts +1 -1
  39. package/{dist/schema → schema}/DatabaseTable.js +2 -1
  40. package/{dist/schema → schema}/SchemaComparator.d.ts +3 -1
  41. package/{dist/schema → schema}/SchemaComparator.js +58 -10
  42. package/{dist/schema → schema}/SchemaGenerator.d.ts +11 -9
  43. package/{dist/schema → schema}/SchemaGenerator.js +81 -28
  44. package/{dist/schema → schema}/SchemaHelper.d.ts +9 -4
  45. package/{dist/schema → schema}/SchemaHelper.js +46 -8
  46. package/{dist/schema → schema}/index.d.ts +0 -0
  47. package/{dist/schema → schema}/index.js +5 -1
  48. package/{dist/typings.d.ts → typings.d.ts} +7 -3
  49. package/{dist/typings.js → typings.js} +0 -0
  50. package/CHANGELOG.md +0 -661
  51. package/dist/AbstractSqlDriver.d.ts +0 -55
  52. package/dist/LICENSE +0 -21
  53. package/dist/package.json +0 -99
@@ -1,55 +0,0 @@
1
- import type { Knex } from 'knex';
2
- import type { AnyEntity, Collection, Configuration, Constructor, CountOptions, DeleteOptions, Dictionary, DriverMethodOptions, EntityData, EntityDictionary, EntityField, EntityMetadata, EntityProperty, FilterQuery, FindOneOptions, FindOptions, IDatabaseDriver, LockOptions, NativeInsertUpdateManyOptions, NativeInsertUpdateOptions, PopulateOptions, Primary, QueryOrderMap, QueryResult, Transaction } from '@mikro-orm/core';
3
- import { DatabaseDriver, EntityManagerType } from '@mikro-orm/core';
4
- import type { AbstractSqlConnection } from './AbstractSqlConnection';
5
- import type { AbstractSqlPlatform } from './AbstractSqlPlatform';
6
- import { QueryBuilder } from './query/QueryBuilder';
7
- import { SqlEntityManager } from './SqlEntityManager';
8
- import type { Field } from './typings';
9
- export declare abstract class AbstractSqlDriver<C extends AbstractSqlConnection = AbstractSqlConnection> extends DatabaseDriver<C> {
10
- [EntityManagerType]: SqlEntityManager<this>;
11
- protected readonly connection: C;
12
- protected readonly replicas: C[];
13
- protected readonly platform: AbstractSqlPlatform;
14
- protected constructor(config: Configuration, platform: AbstractSqlPlatform, connection: Constructor<C>, connector: string[]);
15
- getPlatform(): AbstractSqlPlatform;
16
- createEntityManager<D extends IDatabaseDriver = IDatabaseDriver>(useContext?: boolean): D[typeof EntityManagerType];
17
- find<T, P extends string = never>(entityName: string, where: FilterQuery<T>, options?: FindOptions<T, P>): Promise<EntityData<T>[]>;
18
- findOne<T, P extends string = never>(entityName: string, where: FilterQuery<T>, options?: FindOneOptions<T, P>): Promise<EntityData<T> | null>;
19
- mapResult<T>(result: EntityData<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[], qb?: QueryBuilder<T>, map?: Dictionary): EntityData<T> | null;
20
- private mapJoinedProps;
21
- private appendToCollection;
22
- count<T extends AnyEntity<T>>(entityName: string, where: any, options?: CountOptions<T>, ctx?: Transaction<Knex.Transaction>): Promise<number>;
23
- nativeInsert<T extends AnyEntity<T>>(entityName: string, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
24
- nativeInsertMany<T extends AnyEntity<T>>(entityName: string, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
25
- nativeUpdate<T extends AnyEntity<T>>(entityName: string, where: FilterQuery<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
26
- nativeUpdateMany<T extends AnyEntity<T>>(entityName: string, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
27
- nativeDelete<T extends AnyEntity<T>>(entityName: string, where: FilterQuery<T> | string | any, options?: DeleteOptions<T>): Promise<QueryResult<T>>;
28
- syncCollection<T extends AnyEntity<T>, O extends AnyEntity<O>>(coll: Collection<T, O>, options?: DriverMethodOptions): Promise<void>;
29
- loadFromPivotTable<T, O>(prop: EntityProperty, owners: Primary<O>[][], where?: FilterQuery<T>, orderBy?: QueryOrderMap<T>[], ctx?: Transaction, options?: FindOptions<T>): Promise<Dictionary<T[]>>;
30
- execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(queryOrKnex: string | Knex.QueryBuilder | Knex.Raw, params?: any[], method?: 'all' | 'get' | 'run', ctx?: Transaction): Promise<T>;
31
- protected getTableName<T>(meta: EntityMetadata<T>, options: NativeInsertUpdateManyOptions<T>): string;
32
- /**
33
- * 1:1 owner side needs to be marked for population so QB auto-joins the owner id
34
- */
35
- protected autoJoinOneToOneOwner<T, P extends string = never>(meta: EntityMetadata, populate: PopulateOptions<T>[], fields?: readonly EntityField<T, P>[]): PopulateOptions<T>[];
36
- protected joinedProps<T>(meta: EntityMetadata, populate: PopulateOptions<T>[]): PopulateOptions<T>[];
37
- /**
38
- * @internal
39
- */
40
- mergeJoinedResult<T extends AnyEntity<T>>(rawResults: EntityData<T>[], meta: EntityMetadata<T>): EntityData<T>[];
41
- protected getFieldsForJoinedLoad<T extends AnyEntity<T>>(qb: QueryBuilder<T>, meta: EntityMetadata<T>, explicitFields?: Field<T>[], populate?: PopulateOptions<T>[], parentTableAlias?: string, parentJoinPath?: string): Field<T>[];
42
- /**
43
- * @internal
44
- */
45
- mapPropToFieldNames<T extends AnyEntity<T>>(qb: QueryBuilder<T>, prop: EntityProperty<T>, tableAlias?: string): Field<T>[];
46
- protected createQueryBuilder<T extends AnyEntity<T>>(entityName: string, ctx?: Transaction<Knex.Transaction>, write?: boolean, convertCustomTypes?: boolean): QueryBuilder<T>;
47
- protected extractManyToMany<T extends AnyEntity<T>>(entityName: string, data: EntityDictionary<T>): EntityData<T>;
48
- protected processManyToMany<T extends AnyEntity<T>>(meta: EntityMetadata<T> | undefined, pks: Primary<T>[], collections: EntityData<T>, clear: boolean, options?: DriverMethodOptions): Promise<void>;
49
- protected updateCollectionDiff<T extends AnyEntity<T>, O extends AnyEntity<O>>(meta: EntityMetadata<O>, prop: EntityProperty<T>, pks: Primary<O>[], deleteDiff: Primary<T>[][] | boolean, insertDiff: Primary<T>[][], options?: DriverMethodOptions & {
50
- ownerSchema?: string;
51
- }): Promise<void>;
52
- lockPessimistic<T extends AnyEntity<T>>(entity: T, options: LockOptions): Promise<void>;
53
- protected buildJoinedPropsOrderBy<T extends AnyEntity<T>>(entityName: string, qb: QueryBuilder<T>, meta: EntityMetadata<T>, populate: PopulateOptions<T>[], parentPath?: string): QueryOrderMap<T>[];
54
- protected buildFields<T extends AnyEntity<T>>(meta: EntityMetadata<T>, populate: PopulateOptions<T>[], joinedProps: PopulateOptions<T>[], qb: QueryBuilder<T>, fields?: Field<T>[]): Field<T>[];
55
- }
package/dist/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2018 Martin Adámek
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/dist/package.json DELETED
@@ -1,99 +0,0 @@
1
- {
2
- "name": "@mikro-orm/knex",
3
- "version": "5.0.0",
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
- "main": "index.js",
6
- "module": "index.mjs",
7
- "typings": "index.d.ts",
8
- "exports": {
9
- "./package.json": "./package.json",
10
- ".": {
11
- "import": "./index.mjs",
12
- "require": "./index.js"
13
- }
14
- },
15
- "repository": {
16
- "type": "git",
17
- "url": "git+ssh://git@github.com/mikro-orm/mikro-orm.git"
18
- },
19
- "keywords": [
20
- "orm",
21
- "mongo",
22
- "mongodb",
23
- "mysql",
24
- "mariadb",
25
- "postgresql",
26
- "sqlite",
27
- "sqlite3",
28
- "ts",
29
- "typescript",
30
- "js",
31
- "javascript",
32
- "entity",
33
- "ddd",
34
- "mikro-orm",
35
- "unit-of-work",
36
- "data-mapper",
37
- "identity-map"
38
- ],
39
- "author": "Martin Adámek",
40
- "license": "MIT",
41
- "bugs": {
42
- "url": "https://github.com/mikro-orm/mikro-orm/issues"
43
- },
44
- "homepage": "https://mikro-orm.io",
45
- "engines": {
46
- "node": ">= 14.0.0"
47
- },
48
- "scripts": {
49
- "build": "yarn clean && yarn compile && yarn copy",
50
- "postbuild": "yarn gen-esm-wrapper index.js index.mjs",
51
- "clean": "rimraf ./dist",
52
- "compile": "tsc -p tsconfig.build.json",
53
- "copy": "ts-node -T ../../scripts/copy.ts"
54
- },
55
- "publishConfig": {
56
- "access": "public"
57
- },
58
- "dependencies": {
59
- "fs-extra": "10.0.0",
60
- "knex": "1.0.1",
61
- "sqlstring": "2.3.2"
62
- },
63
- "devDependencies": {
64
- "@mikro-orm/core": "^5.0.0"
65
- },
66
- "peerDependencies": {
67
- "@mikro-orm/core": "^5.0.0",
68
- "@mikro-orm/entity-generator": "^5.0.0",
69
- "@mikro-orm/migrations": "^5.0.0",
70
- "@vscode/sqlite3": "^5.0.0",
71
- "mssql": "^7.0.0",
72
- "mysql": "^2.18.1",
73
- "mysql2": "^2.1.0",
74
- "pg": "^8.0.3"
75
- },
76
- "peerDependenciesMeta": {
77
- "@mikro-orm/entity-generator": {
78
- "optional": true
79
- },
80
- "@mikro-orm/migrations": {
81
- "optional": true
82
- },
83
- "@vscode/sqlite3": {
84
- "optional": true
85
- },
86
- "mssql": {
87
- "optional": true
88
- },
89
- "mysql": {
90
- "optional": true
91
- },
92
- "mysql2": {
93
- "optional": true
94
- },
95
- "pg": {
96
- "optional": true
97
- }
98
- }
99
- }