Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-and-check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
node-version: 20
- name: Install dependencies
run: npm i
- name: Update version
run: npm run update-version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking some more, instead of auto updating on deploy, how about we just check for changes and fail the build. This way, there won't ever me a mismatch between what we see locally on npm run dev vs what is actually deployed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally do not mind too much about the mismatching. I would prefer to just keep the JSON as a placeholder and allow the script to automatically do it. For https://github.com/kuzudb/kuzudb.github.io I do not update LatestVersion.json at all and solely rely on the script to maintain it during the deployment.

@sdht0 sdht0 Jul 14, 2025 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although auto check won't really work for a new release.

I don't really like the magical version rewrite during deploy. I think the better way is to add a commit with the new version, like the auto format CI job.

@mewim mewim Jul 14, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will work for new release though. We usually build the binaries first and then push the docs. Anyway, feel free to change the behavior to allow manual triggering or committing to the branch. I just personally do not care about it.

- name: Build with Astro
if: github.event_name != 'pull_request'
run: npm run build
Expand Down
29 changes: 0 additions & 29 deletions .github/workflows/update-kuzu-version.yml

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ COPY package.json package-lock.json /home/node/app/
WORKDIR /home/node/app
RUN npm i
COPY . .
RUN npm run update-version
RUN npx astro build

FROM httpd:2.4-alpine AS deploy
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"preview": "astro preview",
"astro": "astro",
"check-links": "CHECK_LINKS=true astro build",
"generate-llms": "node scripts/generate-llms.cjs"
"generate-llms": "node scripts/generate-llms.cjs",
"update-version": "node scripts/update-version.cjs"
},
"dependencies": {
"@astrojs/markdown-remark": "^6.3.1",
Expand Down
20 changes: 20 additions & 0 deletions scripts/update-version.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const GITHUB_API_URL = "https://api.github.com/repos/kuzudb/kuzu/releases/latest";
const fs = require('fs/promises');
const path = require('path');

(async () => {
console.log("Fetching latest version from GitHub...");
const response = await fetch(GITHUB_API_URL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a way to manually specify the version, as this script should be run as part of the dev to main release merge, which could be before the actual version has been released.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed the behavior:

  • For the deployment pipeline, there is a way to skip version updating, so that the build process uses the version specified in JSON directly.
  • For dev docker deployment, always use the manually specified version (not doing auto version update).

Since now it is just a JSON file that can easily be edited directly. Using the script or workflow to do version update is mainly for automatically version maintaining but not necessary.

const data = await response.json();
let version = data.tag_name;
version = version.trim();
version = version.substring(1);
console.log(`Latest version is ${version}`);
console.log("Updating version.json...");
const pathToJson = path.resolve(path.join(__dirname, "..", "src", "version.json"));
console.log("Path to version.json: ", pathToJson);
const json = JSON.stringify({ version }, null, 2);
await fs.writeFile(pathToJson, json);
console.log("version.json updated successfully.");
console.log("Done.");
})();
31 changes: 16 additions & 15 deletions src/content/docs/client-apis/c.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ title: C API
---

import { LinkCard } from '@astrojs/starlight/components';
import {version} from '../../../version.json';
import { Code } from 'astro-expressive-code/components';

export const CMAKE_CONTENT =`cmake_minimum_required(VERSION 3.11)
project(example LANGUAGES C)
ExternalProject_Add(kuzu-prebuilt
URL https://github.com/kuzudb/kuzu/releases/download/v${version}/libkuzu-linux-x86_64.tar.gz
)
ExternalProject_Get_Property(kuzu-prebuilt SOURCE_DIR)
add_library(kuzu SHARED IMPORTED)
add_dependencies(kuzu kuzu-prebuilt)
set_target_properties(kuzu PROPERTIES IMPORTED_LOCATION ${"${SOURCE_DIR}"}/libkuzu.so)
target_include_directories(kuzu INTERFACE ${"${SOURCE_DIR}"})
add_executable(example main.c)
target_link_libraries(example kuzu)`

See the following link for the full documentation of the C library API.

Expand All @@ -18,21 +33,7 @@ See the following link for the full documentation of the C library API.
See [Installation](/installation) and [Get Started](/get-started) for simple manual instructions for building with the C library.

Alternatively, here is an example configuration for integrating the pre-built library into a CMake project (substitute `URL` and `URL_HASH` and `libkuzu.so` as appropriate for your platform).
```cmake
cmake_minimum_required(VERSION 3.11)
project(example LANGUAGES C)
ExternalProject_Add(kuzu-prebuilt
URL https://github.com/kuzudb/kuzu/releases/download/v0.11.0/libkuzu-linux-x86_64.tar.gz
URL_HASH SHA256=452599a03c4e6accb797d11bd780a2a88629bddf6635b1703993967d31a0467e
)
ExternalProject_Get_Property(kuzu-prebuilt SOURCE_DIR)
add_library(kuzu SHARED IMPORTED)
add_dependencies(kuzu kuzu-prebuilt)
set_target_properties(kuzu PROPERTIES IMPORTED_LOCATION ${SOURCE_DIR}/libkuzu.so)
target_include_directories(kuzu INTERFACE ${SOURCE_DIR})
add_executable(example main.c)
target_link_libraries(example kuzu)
```
<Code code={CMAKE_CONTENT} lang="cmake"/>

### Linking against Kuzu when built from source

Expand Down
109 changes: 56 additions & 53 deletions src/content/docs/get-started/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,57 @@ title: "Create your first graph"
---

import { Tabs, TabItem } from '@astrojs/starlight/components';
import {version} from '../../../version.json';
import { Code } from 'astro-expressive-code/components';

export const CODE_BLOCKS = {
java: {
maven: `<dependency>
<groupId>com.kuzudb</groupId>
<artifactId>kuzu</artifactId>
<version>${version}</version>
</dependency>`,
groovy: `implementation 'com.kuzudb:kuzu:${version}'`,
kotlin: `implementation("com.kuzudb:kuzu:${version}")`,
gradle: `plugins {
id 'java'
id 'application'
}
application {
mainClassName = "Main"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.kuzudb:kuzu:${version}'
}`,
},
swift:`import PackageDescription

let package = Package(
name: "kuzu-swift-example",
platforms: [
.macOS(.v11),
.iOS(.v14),
],
dependencies: [
.package(url: "https://github.com/kuzudb/kuzu-swift/", branch: "v${version}"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: "kuzu-swift-example",
dependencies: [
.product(name: "Kuzu", package: "kuzu-swift"),
]
),
]
)`

}


Kuzu implements a **structured property graph model** and requires a pre-defined schema.

Expand Down Expand Up @@ -260,26 +311,15 @@ const kuzu = require("kuzu");

Kuzu's Java client library is available on [Maven Central](https://central.sonatype.com/artifact/com.kuzudb/kuzu). You can add the following snippet to your `pom.xml` to get it installed:

```xml
<dependency>
<groupId>com.kuzudb</groupId>
<artifactId>kuzu</artifactId>
<version>0.11.0</version>
</dependency>
```
<Code code={CODE_BLOCKS.java.maven} lang="xml"/>

Alternatively, if you are using Gradle, you can add the following snippet to your build.gradle file to include Kuzu's Java client library:

For Groovy DSL:
```groovy
implementation 'com.kuzudb:kuzu:0.11.0'
```
<Code code={CODE_BLOCKS.java.groovy} lang="groovy"/>

For Kotlin DSL:

```kotlin
implementation("com.kuzudb:kuzu:0.11.0")
```
<Code code={CODE_BLOCKS.java.kotlin} lang="kotlin"/>

Below is an example Gradle project structure for a simple Java application that creates a graph schema and inserts
data into the database for the given example.
Expand All @@ -297,21 +337,7 @@ data into the database for the given example.
```

The minimal `build.gradle` contains the following configurations:
```
plugins {
id 'java'
id 'application'
}
application {
mainClassName = "Main"
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.kuzudb:kuzu:0.11.0'
}
```
<Code code={CODE_BLOCKS.java.gradle} lang="groovy"/>

The `Main.java` contains the following code:

Expand Down Expand Up @@ -503,30 +529,7 @@ swift package init --type=executable

Update the `Package.swift` file:

```swift
import PackageDescription

let package = Package(
name: "kuzu-swift-example",
platforms: [
.macOS(.v11),
.iOS(.v14),
],
dependencies: [
.package(url: "https://github.com/kuzudb/kuzu-swift/", branch: "v0.11.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.executableTarget(
name: "kuzu-swift-example",
dependencies: [
.product(name: "Kuzu", package: "kuzu-swift"),
]
),
]
)
```
<Code code={CODE_BLOCKS.swift} lang="swift"/>

This configuration sets the minimum deployment target and adds the `kuzu-swift` client as a dependency.

Expand Down
Loading