Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 0c811dd

Browse files
authored
Update index.js
1 parent 09d1f7e commit 0c811dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ if (args.length === 0) {
4949
dbPath = args[0];
5050
}
5151

52+
const isReadOnly = process.env.KUZU_READ_ONLY === "true";
53+
5254
process.on("SIGINT", () => {
5355
process.exit(0);
5456
});
@@ -57,7 +59,7 @@ process.on("SIGTERM", () => {
5759
process.exit(0);
5860
});
5961

60-
const db = new kuzu.Database(dbPath);
62+
const db = new kuzu.Database(dbPath, readOnly=isReadOnly);
6163
const conn = new kuzu.Connection(db);
6264

6365
const getPrompt = (question, schema) => {

0 commit comments

Comments
 (0)