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

Commit 6cf7885

Browse files
authored
Handle single file database change (#13)
* Update kuzu dependency to v0.10.2-dev.12 and modify environment variable for database path * Bump kuzu dependency to version 0.11.0
1 parent 875a29d commit 6cf7885

File tree

5 files changed

+21
-15
lines changed

5 files changed

+21
-15
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ EXPOSE 8000
3838
# Set environment variables
3939
ENV NODE_ENV=production
4040
ENV PORT=8000
41-
ENV KUZU_PATH=/database
41+
ENV KUZU_DIR=/database
4242
ENV CROSS_ORIGIN=true
4343

4444
# Run app

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ To access an existing Kùzu database, you can mount its path to the `/database`
1010

1111
```bash
1212
docker run -p 8000:8000 \
13-
-v path/to/database:/database \
13+
-v {path to the directory containing the database file}:/database \
14+
-e KUZU_FILE={database file name} \
1415
--rm kuzudb/api-server:latest
1516
```
1617

17-
By mounting local database files to Docker via `-v path/to/database:/database`,
18-
the changes done through the API server will persist to the local database files after the server is shutdown.
18+
By mounting local database files to Docker via `-v {path to the directory containing the database file}:/database` and `-e KUZU_FILE={database file name}`,
19+
the changes done through the API server will persist to the local database files after the server is shutdown. If the directory is mounted but the `KUZU_FILE` environment variable is not set, the API server will look for a file named `database.kz` in the mounted directory or create a new database file named `database.kz` in the mounted directory if it does not exist.
1920

2021
The `--rm` flag tells docker that the container should automatically be removed after we close docker.
2122

@@ -36,7 +37,8 @@ By default, the API server is launched in read-write mode, which means that you
3637

3738
```bash
3839
docker run -p 8000:8000 \
39-
-v path/to/database:/database \
40+
-v {path to the directory containing the database file}:/database \
41+
-e KUZU_FILE={database file name} \
4042
-e MODE=READ_ONLY \
4143
--rm kuzudb/api-server:latest
4244
```
@@ -57,7 +59,8 @@ For example, to launch the API server with a buffer pool size of 1GB, you can ru
5759

5860
```bash
5961
docker run -p 8000:8000 \
60-
-v path/to/database:/database \
62+
-v {path to the directory containing the database file}:/database \
63+
-e KUZU_FILE={database file name} \
6164
-e KUZU_BUFFER_POOL_SIZE=1073741824 \
6265
--rm kuzudb/api-server:latest
6366
```
@@ -68,7 +71,8 @@ By default, the API server is launched with CORS enabled for all origins. If you
6871

6972
```bash
7073
docker run -p 8000:8000 \
71-
-v path/to/database:/database \
74+
-v {path to the directory containing the database file}:/database \
75+
-e KUZU_FILE={database file name} \
7276
-e CROSS_ORIGIN=false \
7377
--rm kuzudb/api-server:latest
7478
```
@@ -81,15 +85,17 @@ For example:
8185

8286
```bash
8387
podman run -p 8000:8000 \
84-
-v path/to/database:/database:U \
88+
-v {path to the directory containing the database file}:/database:U \
89+
-e KUZU_FILE={database file name} \
8590
--rm kuzudb/api-server:latest
8691
```
8792

8893
or,
8994

9095
```bash
9196
podman run -p 8000:8000 \
92-
-v path/to/database:/database \
97+
-v {path to the directory containing the database file}:/database \
98+
-e KUZU_FILE={database file name} \
9399
--userns=keep-id \
94100
--rm kuzudb/api-server:latest
95101
```

explorer

Submodule explorer updated 56 files

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"cors": "^2.8.5",
1414
"express": "^4.18.2",
15-
"kuzu": "0.10.0",
15+
"kuzu": "0.11.0",
1616
"pino": "^8.16.1",
1717
"pino-pretty": "^10.2.3"
1818
}

0 commit comments

Comments
 (0)