@mikro-orm/sql
Advanced tools
+2
-2
| { | ||
| "name": "@mikro-orm/sql", | ||
| "version": "7.0.0-dev.255", | ||
| "version": "7.0.0-dev.256", | ||
| "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.", | ||
@@ -59,4 +59,4 @@ "type": "module", | ||
| "peerDependencies": { | ||
| "@mikro-orm/core": "7.0.0-dev.255" | ||
| "@mikro-orm/core": "7.0.0-dev.256" | ||
| } | ||
| } |
@@ -7,3 +7,3 @@ import { type EntitySchemaWithMeta, EntityManager, type AnyEntity, type ConnectionType, type EntityData, type EntityName, type EntityRepository, type GetRepository, type QueryResult, type FilterQuery, type LoggingOptions, type RawQueryFragment } from '@mikro-orm/core'; | ||
| import type { Kysely } from 'kysely'; | ||
| import type { InferKyselyDB } from './typings.js'; | ||
| import type { InferClassEntityDB, InferKyselyDB } from './typings.js'; | ||
| import { type MikroKyselyPluginOptions } from './plugin/index.js'; | ||
@@ -28,3 +28,3 @@ export interface GetKyselyOptions extends MikroKyselyPluginOptions { | ||
| */ | ||
| getKysely<TDB = undefined, TOptions extends GetKyselyOptions = GetKyselyOptions>(options?: TOptions): Kysely<TDB extends undefined ? InferKyselyDB<EntitiesFromManager<this>, TOptions> : TDB>; | ||
| getKysely<TDB = undefined, TOptions extends GetKyselyOptions = GetKyselyOptions>(options?: TOptions): Kysely<TDB extends undefined ? InferKyselyDB<EntitiesFromManager<this>, TOptions> & InferClassEntityDB<AllEntitiesFromManager<this>, TOptions> : TDB>; | ||
| execute<T extends QueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[] = EntityData<AnyEntity>[]>(query: string | NativeQueryBuilder | RawQueryFragment, params?: any[], method?: 'all' | 'get' | 'run', loggerContext?: LoggingOptions): Promise<T>; | ||
@@ -35,2 +35,3 @@ getRepository<T extends object, U extends EntityRepository<T> = SqlEntityRepository<T>>(entityName: EntityName<T>): GetRepository<T, U>; | ||
| type EntitiesFromManager<TEntityManager extends EntityManager<any>> = NonNullable<TEntityManager['~entities']> extends any[] ? (Extract<NonNullable<TEntityManager['~entities']>[number], EntitySchemaWithMeta>) : never; | ||
| type AllEntitiesFromManager<TEntityManager extends EntityManager<any>> = NonNullable<TEntityManager['~entities']> extends any[] ? NonNullable<TEntityManager['~entities']>[number] : never; | ||
| export {}; |
+10
-1
| import type { Generated, Kysely } from 'kysely'; | ||
| import type { CheckCallback, DeferMode, Dictionary, EntityName, EntityProperty, EntitySchemaWithMeta, FilterQuery, GroupOperator, IndexColumnOptions, Opt, Primary, PrimaryProperty, QueryFlag, QueryOrderMap, RawQueryFragment, Type } from '@mikro-orm/core'; | ||
| import type { CheckCallback, DeferMode, Dictionary, EntityName, EntityProperty, EntitySchemaWithMeta, FilterQuery, GroupOperator, IndexColumnOptions, InferEntityName, Opt, Primary, PrimaryProperty, QueryFlag, QueryOrderMap, RawQueryFragment, Scalar, Type } from '@mikro-orm/core'; | ||
| import type { JoinType, QueryType } from './query/enums.js'; | ||
@@ -312,2 +312,11 @@ import type { DatabaseSchema } from './schema/DatabaseSchema.js'; | ||
| }; | ||
| export type InferClassEntityDB<TEntities, TOptions extends MikroKyselyPluginOptions = {}> = ClassEntityDBMap<TEntities, TOptions> extends infer R ? [keyof R] extends [never] ? unknown : R : never; | ||
| type ClassEntityDBMap<TEntities, TOptions extends MikroKyselyPluginOptions = {}> = { | ||
| [T in TEntities as ClassEntityTableName<T, TOptions>]: ClassEntityColumns<T>; | ||
| }; | ||
| type ClassEntityTableName<T, TOptions extends MikroKyselyPluginOptions = {}> = T extends abstract new (...args: any[]) => infer Instance ? TransformName<InferEntityName<Instance>, TOptions['tableNamingStrategy'] extends 'entity' ? 'entity' : 'underscore'> : never; | ||
| type ClassEntityColumns<T> = T extends abstract new (...args: any[]) => infer Instance ? { | ||
| [K in keyof Instance as IsClassEntityColumn<K, Instance[K]>]: Instance[K]; | ||
| } : never; | ||
| type IsClassEntityColumn<K, V> = K extends symbol ? never : NonNullable<V> extends Scalar ? K : never; | ||
| export {}; |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
906725
0.13%16098
0.07%