@mikro-orm/sql 7.0.7-dev.11 → 7.0.7-dev.12
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 +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/sql",
|
|
3
|
-
"version": "7.0.7-dev.
|
|
3
|
+
"version": "7.0.7-dev.12",
|
|
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.6"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.0.7-dev.
|
|
56
|
+
"@mikro-orm/core": "7.0.7-dev.12"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|
package/typings.d.ts
CHANGED
|
@@ -252,8 +252,9 @@ export type MapTableName<T extends {
|
|
|
252
252
|
}, TOptions extends MikroKyselyPluginOptions = {}> = {
|
|
253
253
|
[P in T as TOptions['tableNamingStrategy'] extends 'entity' ? P['name'] : PreferStringLiteral<NonNullable<P['tableName']>, P['name']>]: P;
|
|
254
254
|
};
|
|
255
|
+
type ResolveTableNaming<TOptions extends MikroKyselyPluginOptions> = TOptions['tableNamingStrategy'] extends 'entity' ? 'entity' : 'underscore';
|
|
255
256
|
export type MapValueAsTable<TMap extends Record<string, any>, TOptions extends MikroKyselyPluginOptions = {}> = {
|
|
256
|
-
[K in keyof TMap as TransformName<K, TOptions
|
|
257
|
+
[K in keyof TMap as TransformName<K, ResolveTableNaming<TOptions>>]: InferKyselyTable<TMap[K], TOptions>;
|
|
257
258
|
};
|
|
258
259
|
export type InferKyselyTable<TSchema extends EntitySchemaWithMeta, TOptions extends MikroKyselyPluginOptions = {}> = ExcludeNever<{
|
|
259
260
|
-readonly [K in keyof InferEntityProperties<TSchema> as TransformColumnName<K, TOptions['columnNamingStrategy'] extends 'property' ? 'property' : 'underscore', MaybeReturnType<InferEntityProperties<TSchema>[K]>>]: InferColumnValue<MaybeReturnType<InferEntityProperties<TSchema>[K]>, TOptions['processOnCreateHooks'] extends true ? true : false>;
|
|
@@ -320,7 +321,9 @@ export type InferClassEntityDB<TEntities, TOptions extends MikroKyselyPluginOpti
|
|
|
320
321
|
type ClassEntityDBMap<TEntities, TOptions extends MikroKyselyPluginOptions = {}> = {
|
|
321
322
|
[T in TEntities as ClassEntityTableName<T, TOptions>]: ClassEntityColumns<T, TOptions>;
|
|
322
323
|
};
|
|
323
|
-
type ClassEntityTableName<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends
|
|
324
|
+
type ClassEntityTableName<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends {
|
|
325
|
+
'~entityName'?: infer Name extends string;
|
|
326
|
+
} ? TransformName<Name, ResolveTableNaming<TOptions>> : T extends abstract new (...args: any[]) => infer Instance ? TransformName<InferEntityName<Instance>, ResolveTableNaming<TOptions>> : never;
|
|
324
327
|
type ClassEntityColumns<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends abstract new (...args: any[]) => infer Instance ? {
|
|
325
328
|
[K in keyof Instance as ClassEntityColumnName<K, Instance[K], TOptions>]: ClassEntityColumnValue<Instance[K]>;
|
|
326
329
|
} : never;
|