Skip to content

Commit bd50839

Browse files
committed
fix(sqlite): mkdir -p for sqlite path
1 parent 78028a1 commit bd50839

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"tsx": "npm:@cordiverse/tsx@4.19.3-fix.3",
3333
"typescript": "^5.9.3",
3434
"yakumo": "^3.1.1",
35-
"yakumo-esbuild": "^3.0.1",
35+
"yakumo-esbuild": "^3.0.2",
3636
"yakumo-mocha": "^3.0.3",
3737
"yakumo-tsc": "^3.0.1",
3838
"yml-register": "^1.2.5"

packages/sqlite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cordisjs/plugin-database-sqlite",
3-
"version": "5.0.3",
3+
"version": "5.0.4",
44
"description": "SQLite Driver for Minato",
55
"type": "module",
66
"main": "lib/index.js",

packages/sqlite/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import enUS from './locales/en-US.yml'
88
import zhCN from './locales/zh-CN.yml'
99
import { SQLiteBuilder } from './builder'
1010
import { fileURLToPath } from 'node:url'
11+
import { mkdirSync } from 'node:fs'
12+
import { dirname } from 'node:path'
1113
import z from 'schemastery'
1214

1315
function getTypeDef({ deftype: type }: Field) {
@@ -164,6 +166,7 @@ export class SQLiteDriver extends Driver<SQLiteDriver.Config> {
164166
this.path = this.config.path
165167
if (this.path !== ':memory:') {
166168
this.path = fileURLToPath(new URL(this.path, this.ctx.baseUrl))
169+
mkdirSync(dirname(this.path), { recursive: true })
167170
}
168171

169172
const { DatabaseSync } = await import('node:sqlite')

0 commit comments

Comments
 (0)