@atri-bot/lib-db 2.0.4 → 2.0.5
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/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { MigrationConfig } from "drizzle-orm/migrator";
|
|
|
5
5
|
|
|
6
6
|
//#region src/index.d.ts
|
|
7
7
|
interface DbPluginProps<TSchema extends Record<string, unknown>, TRelations extends AnyRelations> {
|
|
8
|
-
drizzle
|
|
8
|
+
drizzle?: BunSQLDatabase<TSchema, TRelations> & {
|
|
9
9
|
$client: Bun.SQL;
|
|
10
10
|
};
|
|
11
11
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{definePlugin as e}from"@atri-bot/core";import{drizzle as t}from"drizzle-orm/bun-sql";import{migrate as n}from"drizzle-orm/bun-sql/migrator";var r=`@atri-bot/lib-db`;function i(i){return e({pluginName:r,defaultConfig:{connectionString:``},drizzle
|
|
1
|
+
import{definePlugin as e}from"@atri-bot/core";import{drizzle as t}from"drizzle-orm/bun-sql";import{migrate as n}from"drizzle-orm/bun-sql/migrator";var r=`@atri-bot/lib-db`;function i(i){return e(()=>{let e;return{pluginName:r,defaultConfig:{connectionString:``},get drizzle(){return e},async install(){let r=i.connectionString??this.config.connectionString;if(!r||r===``){let e=`请至少通过插件配置文件或 DbPlugin options 提供 connectionString 参数。`;throw this.logger.ERROR(e),Error(e)}e=t(r,i.config),i.migration&&await n(e,{...i.migration,migrationsTable:i.migration.migrationsTable??`migrations_${i.pluginName}`})},uninstall(){e=void 0}}})}export{i as DbPlugin};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atri-bot/lib-db",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"description": "db lib for atri framework",
|
|
6
6
|
"author": "huan_kong",
|
|
7
7
|
"license": "MIT",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"typecheck": "tsc --noEmit -p tsconfig.json --composite false"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@atri-bot/core": "^2.0.
|
|
19
|
+
"@atri-bot/core": "^2.0.7",
|
|
20
20
|
"@huan_kong/logger": "^2.0.2",
|
|
21
21
|
"drizzle-orm": "^1.0.0-beta.19"
|
|
22
22
|
}
|