@mikro-orm/libsql 7.0.17 → 7.0.18-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 +4 -4
- package/README.md +2 -1
- package/package.json +3 -3
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
|
@@ -2,17 +2,17 @@ import { type AnyEntity, type EntityClass, type EntitySchema, type MikroORM, typ
|
|
|
2
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
|
-
export type LibSqlOptions<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> = Partial<Options<LibSqlDriver, EM, Entities>>;
|
|
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>>;
|
|
6
6
|
/** Creates a type-safe configuration object for the libSQL driver. */
|
|
7
|
-
export declare function defineLibSqlConfig<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]>(options: LibSqlOptions<EM, Entities>): LibSqlOptions<EM, Entities>;
|
|
7
|
+
export declare function defineLibSqlConfig<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends readonly (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]>(options: LibSqlOptions<EM, Entities>): LibSqlOptions<EM, Entities>;
|
|
8
8
|
/**
|
|
9
9
|
* @inheritDoc
|
|
10
10
|
*/
|
|
11
|
-
export declare class LibSqlMikroORM<EM extends SqlEntityManager<LibSqlDriver> = SqlEntityManager<LibSqlDriver>, Entities extends (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]> extends SqlMikroORM<LibSqlDriver, EM, Entities> {
|
|
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
|
*/
|
|
15
|
-
static init<D extends IDatabaseDriver = LibSqlDriver, 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>>;
|
|
15
|
+
static init<D extends IDatabaseDriver = LibSqlDriver, EM extends EntityManager<D> = D[typeof EntityManagerType] & EntityManager<D>, Entities extends readonly (string | EntityClass<AnyEntity> | EntitySchema)[] = (string | EntityClass<AnyEntity> | EntitySchema)[]>(options: Partial<Options<D, EM, Entities>>): Promise<MikroORM<D, EM, Entities>>;
|
|
16
16
|
/**
|
|
17
17
|
* @inheritDoc
|
|
18
18
|
*/
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/libsql",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.18-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,7 +47,7 @@
|
|
|
47
47
|
"copy": "node ../../scripts/copy.mjs"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mikro-orm/sql": "7.0.
|
|
50
|
+
"@mikro-orm/sql": "7.0.18-dev.0",
|
|
51
51
|
"kysely": "0.29.2",
|
|
52
52
|
"libsql": "0.5.29"
|
|
53
53
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@mikro-orm/core": "^7.0.17"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@mikro-orm/core": "7.0.
|
|
58
|
+
"@mikro-orm/core": "7.0.18-dev.0"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">= 22.17.0"
|