@mikro-orm/sql 7.0.5-dev.2 → 7.0.5-dev.4
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 +2 -2
- package/typings.d.ts +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.0.5-dev.
|
|
3
|
+
"version": "7.0.5-dev.4",
|
|
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.0.4"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.0.5-dev.
|
|
56
|
+
"@mikro-orm/core": "7.0.5-dev.4"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
package/typings.d.ts
CHANGED
|
@@ -316,11 +316,16 @@ type ExcludeNever<TMap extends Record<string, any>> = {
|
|
|
316
316
|
};
|
|
317
317
|
export type InferClassEntityDB<TEntities, TOptions extends MikroKyselyPluginOptions = {}> = ClassEntityDBMap<TEntities, TOptions> extends infer R ? ([keyof R] extends [never] ? unknown : R) : never;
|
|
318
318
|
type ClassEntityDBMap<TEntities, TOptions extends MikroKyselyPluginOptions = {}> = {
|
|
319
|
-
[T in TEntities as ClassEntityTableName<T, TOptions>]: ClassEntityColumns<T>;
|
|
319
|
+
[T in TEntities as ClassEntityTableName<T, TOptions>]: ClassEntityColumns<T, TOptions>;
|
|
320
320
|
};
|
|
321
321
|
type ClassEntityTableName<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends abstract new (...args: any[]) => infer Instance ? TransformName<InferEntityName<Instance>, TOptions['tableNamingStrategy'] extends 'entity' ? 'entity' : 'underscore'> : never;
|
|
322
|
-
type ClassEntityColumns<T> = T extends abstract new (...args: any[]) => infer Instance ? {
|
|
323
|
-
[K in keyof Instance as
|
|
322
|
+
type ClassEntityColumns<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends abstract new (...args: any[]) => infer Instance ? {
|
|
323
|
+
[K in keyof Instance as ClassEntityColumnName<K, Instance[K], TOptions>]: ClassEntityColumnValue<Instance[K]>;
|
|
324
324
|
} : never;
|
|
325
|
-
type
|
|
325
|
+
type ClassEntityColumnName<K, V, TOptions extends MikroKyselyPluginOptions = {}> = K extends symbol ? never : NonNullable<V> extends infer NV ? NV extends {
|
|
326
|
+
[k: number]: any;
|
|
327
|
+
readonly owner: object;
|
|
328
|
+
} ? never : TOptions['columnNamingStrategy'] extends 'property' ? K : NV extends Scalar ? K extends string ? SnakeCase<K> : never : K extends string ? ClassEntityJoinColumnName<SnakeCase<K>, NV> : never : never;
|
|
329
|
+
type ClassEntityJoinColumnName<TName extends string, V> = PrimaryProperty<V> extends string ? `${TName}_${SnakeCase<PrimaryProperty<V>>}` : never;
|
|
330
|
+
type ClassEntityColumnValue<V> = NonNullable<V> extends Scalar ? V : Primary<NonNullable<V>>;
|
|
326
331
|
export {};
|