@deterministic-code/datasources-mongodb 0.0.0-stage → 0.1.3
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/dist/MongoDbDriver.d.ts +8 -0
- package/dist/MongoDbDriver.js +9 -0
- package/dist/connection.d.ts +6 -0
- package/dist/connection.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +21 -4
- package/README.md +0 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Cell, type DatasourceOptions, type ICommand, type IConnection, type IDriver, type ITransaction, type IsolationLevel, type TypeConverter } from "@deterministic-code/datasources";
|
|
2
|
+
export declare class MongoDbDriver implements IDriver {
|
|
3
|
+
rowTypeConverters: Record<string, TypeConverter<Cell, Cell>>;
|
|
4
|
+
columnType: (name: string) => string;
|
|
5
|
+
connection: (options?: DatasourceOptions) => IConnection;
|
|
6
|
+
command: (connection: IConnection) => ICommand;
|
|
7
|
+
transaction: (connection: IConnection, _isolation?: IsolationLevel) => ITransaction;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { columnType as identityColumnType, StubTransaction, } from "@deterministic-code/datasources";
|
|
2
|
+
import { MongoDbConnection } from "./connection.js";
|
|
3
|
+
export class MongoDbDriver {
|
|
4
|
+
rowTypeConverters = {};
|
|
5
|
+
columnType = identityColumnType;
|
|
6
|
+
connection = (options) => MongoDbConnection.from(options);
|
|
7
|
+
command = (connection) => connection.createCommand();
|
|
8
|
+
transaction = (connection, _isolation) => new StubTransaction(connection.provider, connection);
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StubConnection, type DatasourceOptions, type ICommand } from "@deterministic-code/datasources";
|
|
2
|
+
export declare class MongoDbConnection extends StubConnection {
|
|
3
|
+
constructor(_options?: DatasourceOptions);
|
|
4
|
+
createCommand: () => ICommand;
|
|
5
|
+
static from: (options?: DatasourceOptions) => MongoDbConnection;
|
|
6
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { StubCommand, StubConnection, } from "@deterministic-code/datasources";
|
|
2
|
+
export class MongoDbConnection extends StubConnection {
|
|
3
|
+
constructor(_options) {
|
|
4
|
+
super("mongodb");
|
|
5
|
+
}
|
|
6
|
+
createCommand = () => new StubCommand(this.provider, this);
|
|
7
|
+
static from = (options) => new MongoDbConnection(options);
|
|
8
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MongoDbDriver } from "./MongoDbDriver.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MongoDbDriver } from "./MongoDbDriver.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deterministic-code/datasources-mongodb",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.js",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@deterministic-code/datasources": "^0.1.3"
|
|
22
|
+
}
|
|
23
|
+
}
|
package/README.md
DELETED