@mikro-orm/libsql 7.1.0-dev.9 → 7.1.1-dev.0
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/LibSqlConnection.d.ts +3 -0
- package/LibSqlConnection.js +4 -0
- package/LibSqlMikroORM.d.ts +3 -3
- package/LibSqlMikroORM.js +3 -2
- package/README.md +2 -1
- package/index.d.ts +4 -0
- package/index.js +2 -0
- package/package.json +5 -5
package/LibSqlConnection.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseSqliteConnection, type Dictionary } from '@mikro-orm/sql';
|
|
2
2
|
import { type Options } from 'libsql';
|
|
3
|
+
import type { Routine, Transaction } from '@mikro-orm/core';
|
|
3
4
|
import { LibSqlDialect } from './LibSqlDialect.js';
|
|
4
5
|
/** libSQL database connection supporting both local and remote databases. */
|
|
5
6
|
export declare class LibSqlConnection extends BaseSqliteConnection {
|
|
@@ -8,6 +9,8 @@ export declare class LibSqlConnection extends BaseSqliteConnection {
|
|
|
8
9
|
skipOnConnect?: boolean;
|
|
9
10
|
}): Promise<void>;
|
|
10
11
|
createKyselyDialect(options: Dictionary & Options): LibSqlDialect;
|
|
12
|
+
/** libsql's `Database.function()` is declared but throws "not implemented"; better-sqlite3 has the UDF bridge. */
|
|
13
|
+
callRoutine<T>(routine: Routine, _args?: Record<string, unknown>, _ctx?: Transaction): Promise<T>;
|
|
11
14
|
/** @inheritDoc */
|
|
12
15
|
executeDump(source: string): Promise<void>;
|
|
13
16
|
private validateAttachSupport;
|
package/LibSqlConnection.js
CHANGED
|
@@ -18,6 +18,10 @@ export class LibSqlConnection extends BaseSqliteConnection {
|
|
|
18
18
|
onCreateConnection: this.options.onCreateConnection ?? this.config.get('onCreateConnection'),
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
+
/** libsql's `Database.function()` is declared but throws "not implemented"; better-sqlite3 has the UDF bridge. */
|
|
22
|
+
async callRoutine(routine, _args = {}, _ctx) {
|
|
23
|
+
throw new Error(`Stored routines are not supported on libSQL. The libsql client does not implement user-defined-function registration; calling routine ${routine.name} would fail at runtime. Use the better-sqlite3 driver for cross-DB testing, or call against a server-side database.`);
|
|
24
|
+
}
|
|
21
25
|
/** @inheritDoc */
|
|
22
26
|
async executeDump(source) {
|
|
23
27
|
await this.ensureConnection();
|
package/LibSqlMikroORM.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AnyEntity, type EntityClass, type EntitySchema, MikroORM, type Options, type IDatabaseDriver, type EntityManager, type EntityManagerType } from '@mikro-orm/core';
|
|
2
|
-
import type
|
|
1
|
+
import { type AnyEntity, type EntityClass, type EntitySchema, type MikroORM, type Options, type IDatabaseDriver, type EntityManager, type EntityManagerType } from '@mikro-orm/core';
|
|
2
|
+
import { SqlMikroORM, type SqlEntityManager } from '@mikro-orm/sql';
|
|
3
3
|
import { LibSqlDriver } from './LibSqlDriver.js';
|
|
4
4
|
/** Configuration options for the libSQL driver. */
|
|
5
5
|
export type LibSqlOptions<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends readonly (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> = Partial<Options<LibSqlDriver, EM, Entities>>;
|
|
@@ -8,7 +8,7 @@ export declare function defineLibSqlConfig<EM extends SqlEntityManager<LibSqlDri
|
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDoc
|
|
10
10
|
*/
|
|
11
|
-
export declare class LibSqlMikroORM<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends readonly (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> extends
|
|
11
|
+
export declare class LibSqlMikroORM<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends readonly (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> extends SqlMikroORM<LibSqlDriver, EM, Entities> {
|
|
12
12
|
/**
|
|
13
13
|
* @inheritDoc
|
|
14
14
|
*/
|
package/LibSqlMikroORM.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineConfig,
|
|
1
|
+
import { defineConfig, } from '@mikro-orm/core';
|
|
2
|
+
import { SqlMikroORM } from '@mikro-orm/sql';
|
|
2
3
|
import { LibSqlDriver } from './LibSqlDriver.js';
|
|
3
4
|
/** Creates a type-safe configuration object for the libSQL driver. */
|
|
4
5
|
export function defineLibSqlConfig(options) {
|
|
@@ -7,7 +8,7 @@ export function defineLibSqlConfig(options) {
|
|
|
7
8
|
/**
|
|
8
9
|
* @inheritDoc
|
|
9
10
|
*/
|
|
10
|
-
export class LibSqlMikroORM extends
|
|
11
|
+
export class LibSqlMikroORM extends SqlMikroORM {
|
|
11
12
|
/**
|
|
12
13
|
* @inheritDoc
|
|
13
14
|
*/
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<a href="https://mikro-orm.io"><img src="https://raw.githubusercontent.com/mikro-orm/mikro-orm/master/docs/static/img/logo-readme.svg?sanitize=true" alt="MikroORM" /></a>
|
|
3
3
|
</h1>
|
|
4
4
|
|
|
5
|
-
TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-orm.io/docs/unit-of-work/) and [Identity Map](https://mikro-orm.io/docs/identity-map/) patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL, SQLite (including libSQL), MSSQL and Oracle databases.
|
|
5
|
+
TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-orm.io/docs/unit-of-work/) and [Identity Map](https://mikro-orm.io/docs/identity-map/) patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL (including CockroachDB and PGlite), SQLite (including libSQL), MSSQL and Oracle databases.
|
|
6
6
|
|
|
7
7
|
> Heavily inspired by [Doctrine](https://www.doctrine-project.org/) and [Hibernate](https://hibernate.org/).
|
|
8
8
|
|
|
@@ -19,6 +19,7 @@ Install a driver package for your database:
|
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
21
|
npm install @mikro-orm/postgresql # PostgreSQL
|
|
22
|
+
npm install @mikro-orm/pglite # PGlite (embedded PostgreSQL in WASM)
|
|
22
23
|
npm install @mikro-orm/mysql # MySQL
|
|
23
24
|
npm install @mikro-orm/mariadb # MariaDB
|
|
24
25
|
npm install @mikro-orm/sqlite # SQLite
|
package/index.d.ts
CHANGED
|
@@ -2,3 +2,7 @@ export * from '@mikro-orm/sql';
|
|
|
2
2
|
export * from './LibSqlConnection.js';
|
|
3
3
|
export * from './LibSqlDriver.js';
|
|
4
4
|
export { LibSqlMikroORM as MikroORM, type LibSqlOptions as Options, defineLibSqlConfig as defineConfig, } from './LibSqlMikroORM.js';
|
|
5
|
+
import { type AbstractSqlDriver, SqlEntityManager } from '@mikro-orm/sql';
|
|
6
|
+
import type { LibSqlDriver } from './LibSqlDriver.js';
|
|
7
|
+
export type EntityManager<Driver extends AbstractSqlDriver = LibSqlDriver> = SqlEntityManager<Driver>;
|
|
8
|
+
export declare const EntityManager: typeof SqlEntityManager;
|
package/index.js
CHANGED
|
@@ -2,3 +2,5 @@ export * from '@mikro-orm/sql';
|
|
|
2
2
|
export * from './LibSqlConnection.js';
|
|
3
3
|
export * from './LibSqlDriver.js';
|
|
4
4
|
export { LibSqlMikroORM as MikroORM, defineLibSqlConfig as defineConfig, } from './LibSqlMikroORM.js';
|
|
5
|
+
import { SqlEntityManager } from '@mikro-orm/sql';
|
|
6
|
+
export const EntityManager = SqlEntityManager;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/libsql",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1-dev.0",
|
|
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",
|
|
@@ -47,15 +47,15 @@
|
|
|
47
47
|
"copy": "node ../../scripts/copy.mjs"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mikro-orm/sql": "7.1.
|
|
51
|
-
"kysely": "0.
|
|
50
|
+
"@mikro-orm/sql": "7.1.1-dev.0",
|
|
51
|
+
"kysely": "0.29.2",
|
|
52
52
|
"libsql": "0.5.29"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@mikro-orm/core": "^7.0
|
|
55
|
+
"@mikro-orm/core": "^7.1.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@mikro-orm/core": "7.1.
|
|
58
|
+
"@mikro-orm/core": "7.1.1-dev.0"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">= 22.17.0"
|