From c7ac1202c6028ea917fefd42b7c4e4e3e29b77ab Mon Sep 17 00:00:00 2001 From: ZZY <2450266535@qq.com> Date: Wed, 23 Oct 2024 23:05:28 +0800 Subject: [PATCH] =?UTF-8?q?refactor(db):=20=E9=87=8D=E6=9E=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=95=B0=E6=8D=AE=E5=BA=93=E8=B7=AF=E5=BE=84=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 .gitignore 文件,忽略数据库文件 - 修改 test_db.js 文件,使用相对路径获取数据库文件 --- .gitignore | 1 + db/test_db.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 83d2183..e563941 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .* !.gitignore *-*/ +*.db node_modules/ test/ package-lock.json \ No newline at end of file diff --git a/db/test_db.js b/db/test_db.js index 47c5f2b..13ea23b 100644 --- a/db/test_db.js +++ b/db/test_db.js @@ -1,6 +1,7 @@ -const betterSqlite3DB = require('db_utils'); +const betterSqlite3DB = require('./db_utils'); +const path = require('path'); -const db_path = utils.path.join('.', 'sqlite3.db'); +const db_path = path.join(__dirname, 'sqlite3.db'); const db = new betterSqlite3DB(db_path, null); db.createTable('test', [