@mikro-orm/sqlite
Advanced tools
+1
-5
| export * from '@mikro-orm/sql'; | ||
| export * from './SqliteConnection.js'; | ||
| export { SqliteDriver } from './SqliteDriver.js'; | ||
| export { | ||
| SqliteMikroORM as MikroORM, | ||
| type SqliteOptions as Options, | ||
| defineSqliteConfig as defineConfig, | ||
| } from './SqliteMikroORM.js'; | ||
| export { SqliteMikroORM as MikroORM, type SqliteOptions as Options, defineSqliteConfig as defineConfig, } from './SqliteMikroORM.js'; |
+1
-1
| export * from '@mikro-orm/sql'; | ||
| export * from './SqliteConnection.js'; | ||
| export { SqliteDriver } from './SqliteDriver.js'; | ||
| export { SqliteMikroORM as MikroORM, defineSqliteConfig as defineConfig } from './SqliteMikroORM.js'; | ||
| export { SqliteMikroORM as MikroORM, defineSqliteConfig as defineConfig, } from './SqliteMikroORM.js'; |
+3
-3
| { | ||
| "name": "@mikro-orm/sqlite", | ||
| "version": "7.0.4", | ||
| "version": "7.0.5-dev.0", | ||
| "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.", | ||
@@ -50,3 +50,3 @@ "keywords": [ | ||
| "dependencies": { | ||
| "@mikro-orm/sql": "7.0.4", | ||
| "@mikro-orm/sql": "7.0.5-dev.0", | ||
| "better-sqlite3": "12.8.0", | ||
@@ -59,3 +59,3 @@ "kysely": "0.28.13" | ||
| "peerDependencies": { | ||
| "@mikro-orm/core": "7.0.4" | ||
| "@mikro-orm/core": "7.0.5-dev.0" | ||
| }, | ||
@@ -62,0 +62,0 @@ "engines": { |
+1
-1
@@ -136,3 +136,3 @@ <h1 align="center"> | ||
| author.name = 'Jon Snow II'; | ||
| author.books.getItems().forEach(book => (book.title += ' (2nd ed.)')); | ||
| author.books.getItems().forEach(book => book.title += ' (2nd ed.)'); | ||
| author.books.add(orm.em.create(Book, { title: 'New Book', author })); | ||
@@ -139,0 +139,0 @@ |
@@ -5,6 +5,6 @@ import { BaseSqliteConnection, type Dictionary } from '@mikro-orm/sql'; | ||
| export declare class SqliteConnection extends BaseSqliteConnection { | ||
| private database; | ||
| createKyselyDialect(options: Dictionary): Dialect; | ||
| /** @inheritDoc */ | ||
| executeDump(dump: string): Promise<void>; | ||
| private database; | ||
| createKyselyDialect(options: Dictionary): Dialect; | ||
| /** @inheritDoc */ | ||
| executeDump(dump: string): Promise<void>; | ||
| } |
+14
-14
@@ -6,16 +6,16 @@ import { BaseSqliteConnection } from '@mikro-orm/sql'; | ||
| export class SqliteConnection extends BaseSqliteConnection { | ||
| database; | ||
| createKyselyDialect(options) { | ||
| const dbName = options.dbName ?? this.config.get('dbName'); | ||
| this.database = new Database(dbName, options); | ||
| return new SqliteDialect({ | ||
| database: this.database, | ||
| onCreateConnection: this.options.onCreateConnection ?? this.config.get('onCreateConnection'), | ||
| }); | ||
| } | ||
| /** @inheritDoc */ | ||
| async executeDump(dump) { | ||
| await this.ensureConnection(); | ||
| this.database.exec(dump); | ||
| } | ||
| database; | ||
| createKyselyDialect(options) { | ||
| const dbName = options.dbName ?? this.config.get('dbName'); | ||
| this.database = new Database(dbName, options); | ||
| return new SqliteDialect({ | ||
| database: this.database, | ||
| onCreateConnection: this.options.onCreateConnection ?? this.config.get('onCreateConnection'), | ||
| }); | ||
| } | ||
| /** @inheritDoc */ | ||
| async executeDump(dump) { | ||
| await this.ensureConnection(); | ||
| this.database.exec(dump); | ||
| } | ||
| } |
@@ -7,5 +7,5 @@ import type { Configuration, Constructor } from '@mikro-orm/core'; | ||
| export declare class SqliteDriver extends AbstractSqlDriver<SqliteConnection> { | ||
| constructor(config: Configuration); | ||
| /** @inheritDoc */ | ||
| getORMClass(): Constructor<SqliteMikroORM>; | ||
| constructor(config: Configuration); | ||
| /** @inheritDoc */ | ||
| getORMClass(): Constructor<SqliteMikroORM>; | ||
| } |
+7
-7
@@ -6,9 +6,9 @@ import { AbstractSqlDriver, SqlitePlatform } from '@mikro-orm/sql'; | ||
| export class SqliteDriver extends AbstractSqlDriver { | ||
| constructor(config) { | ||
| super(config, new SqlitePlatform(), SqliteConnection, ['kysely', 'better-sqlite3']); | ||
| } | ||
| /** @inheritDoc */ | ||
| getORMClass() { | ||
| return SqliteMikroORM; | ||
| } | ||
| constructor(config) { | ||
| super(config, new SqlitePlatform(), SqliteConnection, ['kysely', 'better-sqlite3']); | ||
| } | ||
| /** @inheritDoc */ | ||
| getORMClass() { | ||
| return SqliteMikroORM; | ||
| } | ||
| } |
+12
-50
@@ -1,58 +0,20 @@ | ||
| import { | ||
| type AnyEntity, | ||
| type EntityClass, | ||
| type EntitySchema, | ||
| MikroORM, | ||
| type Options, | ||
| type IDatabaseDriver, | ||
| type EntityManager, | ||
| type EntityManagerType, | ||
| } from '@mikro-orm/core'; | ||
| import { type AnyEntity, type EntityClass, type EntitySchema, MikroORM, type Options, type IDatabaseDriver, type EntityManager, type EntityManagerType } from '@mikro-orm/core'; | ||
| import type { SqlEntityManager } from '@mikro-orm/sql'; | ||
| import { SqliteDriver } from './SqliteDriver.js'; | ||
| /** Configuration options for the SQLite driver. */ | ||
| export type SqliteOptions< | ||
| EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, | ||
| Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = ( | ||
| | string | ||
| | EntityClass<AnyEntity> | ||
| | EntitySchema | ||
| )[], | ||
| > = Partial<Options<SqliteDriver, EM, Entities>>; | ||
| export type SqliteOptions<EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> = Partial<Options<SqliteDriver, EM, Entities>>; | ||
| /** Creates a type-safe configuration object for the SQLite driver. */ | ||
| export declare function defineSqliteConfig< | ||
| EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, | ||
| Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = ( | ||
| | string | ||
| | EntityClass<AnyEntity> | ||
| | EntitySchema | ||
| )[], | ||
| >(options: Partial<Options<SqliteDriver, EM, Entities>>): Partial<Options<SqliteDriver, EM, Entities>>; | ||
| export declare function defineSqliteConfig<EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]>(options: Partial<Options<SqliteDriver, EM, Entities>>): Partial<Options<SqliteDriver, EM, Entities>>; | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| export declare class SqliteMikroORM< | ||
| EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, | ||
| Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = ( | ||
| | string | ||
| | EntityClass<AnyEntity> | ||
| | EntitySchema | ||
| )[], | ||
| > extends MikroORM<SqliteDriver, EM, Entities> { | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| static init< | ||
| D extends IDatabaseDriver = SqliteDriver, | ||
| EM extends EntityManager<D> = D[typeof EntityManagerType] & EntityManager<D>, | ||
| Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = ( | ||
| | string | ||
| | EntityClass<AnyEntity> | ||
| | EntitySchema | ||
| )[], | ||
| >(options: Partial<Options<D, EM, Entities>>): Promise<MikroORM<D, EM, Entities>>; | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| constructor(options: Partial<Options<SqliteDriver, EM, Entities>>); | ||
| export declare class SqliteMikroORM<EM extends SqlEntityManager<SqliteDriver> = SqlEntityManager<SqliteDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> extends MikroORM<SqliteDriver, EM, Entities> { | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| static init<D extends IDatabaseDriver = SqliteDriver, EM extends EntityManager<D> = D[typeof EntityManagerType] & EntityManager<D>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]>(options: Partial<Options<D, EM, Entities>>): Promise<MikroORM<D, EM, Entities>>; | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| constructor(options: Partial<Options<SqliteDriver, EM, Entities>>); | ||
| } |
+14
-14
@@ -1,6 +0,6 @@ | ||
| import { defineConfig, MikroORM } from '@mikro-orm/core'; | ||
| import { defineConfig, MikroORM, } from '@mikro-orm/core'; | ||
| import { SqliteDriver } from './SqliteDriver.js'; | ||
| /** Creates a type-safe configuration object for the SQLite driver. */ | ||
| export function defineSqliteConfig(options) { | ||
| return defineConfig({ driver: SqliteDriver, ...options }); | ||
| return defineConfig({ driver: SqliteDriver, ...options }); | ||
| } | ||
@@ -11,14 +11,14 @@ /** | ||
| export class SqliteMikroORM extends MikroORM { | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| static async init(options) { | ||
| return super.init(defineSqliteConfig(options)); | ||
| } | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| constructor(options) { | ||
| super(defineSqliteConfig(options)); | ||
| } | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| static async init(options) { | ||
| return super.init(defineSqliteConfig(options)); | ||
| } | ||
| /** | ||
| * @inheritDoc | ||
| */ | ||
| constructor(options) { | ||
| super(defineSqliteConfig(options)); | ||
| } | ||
| } |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
17118
0.02%105
-27.59%1
Infinity%+ Added
+ Added
- Removed
- Removed
Updated