Skip to content

Commit 3ef3668

Browse files
author
Dylan Storey
committed
GraphQLite v0.0.1-alpha.1
SQLite extension for graph queries using Cypher syntax. Features: - OpenCypher-compatible query language - Node and relationship CRUD operations - Pattern matching with variable-length paths - WITH, UNWIND, CASE, MERGE clauses - Aggregation functions (count, sum, avg, min, max, collect) - Graph algorithms (PageRank, Label Propagation) - Python and Rust bindings - CI/CD pipelines for testing and releases
1 parent 92a62dc commit 3ef3668

File tree

146 files changed

+22858
-3553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+22858
-3553
lines changed

.github/workflows/ci-fast.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI Fast
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Install dependencies
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install -y bison flex libsqlite3-dev libcunit1-dev
18+
19+
- name: Build extension
20+
run: make extension
21+
22+
- name: Run unit tests
23+
run: make test-unit
24+
25+
- name: Run functional tests
26+
run: make test-functional
27+
28+
rust-check:
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Install Rust toolchain
35+
uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: clippy
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo apt-get update
42+
sudo apt-get install -y bison flex libsqlite3-dev
43+
44+
- name: Build extension
45+
run: make extension
46+
47+
- name: Cargo check
48+
working-directory: bindings/rust
49+
run: cargo check
50+
51+
- name: Cargo clippy
52+
working-directory: bindings/rust
53+
run: cargo clippy -- -D warnings
54+
55+
python-check:
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Set up Python
62+
uses: actions/setup-python@v5
63+
with:
64+
python-version: '3.11'
65+
66+
- name: Install dependencies
67+
run: |
68+
sudo apt-get update
69+
sudo apt-get install -y bison flex libsqlite3-dev
70+
71+
- name: Build extension
72+
run: make extension
73+
74+
- name: Install Python package
75+
working-directory: bindings/python
76+
run: pip install -e ".[dev]"
77+
78+
- name: Run Python tests
79+
working-directory: bindings/python
80+
run: pytest tests/ -v

.github/workflows/ci-full.yml

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
name: CI Full
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build-and-test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest, macos-latest]
13+
14+
runs-on: ${{ matrix.os }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install dependencies (Linux)
20+
if: runner.os == 'Linux'
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install -y bison flex libsqlite3-dev libcunit1-dev
24+
25+
- name: Install dependencies (macOS)
26+
if: runner.os == 'macOS'
27+
run: |
28+
brew install bison flex sqlite cunit
29+
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
30+
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
31+
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
32+
echo "SQLITE_PREFIX=$(brew --prefix sqlite)" >> $GITHUB_ENV
33+
34+
- name: Build extension (Linux)
35+
if: runner.os == 'Linux'
36+
run: make extension
37+
38+
- name: Build extension (macOS)
39+
if: runner.os == 'macOS'
40+
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
41+
42+
- name: Run unit tests (Linux)
43+
if: runner.os == 'Linux'
44+
run: make test-unit
45+
46+
- name: Run unit tests (macOS)
47+
if: runner.os == 'macOS'
48+
run: make test-unit EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
49+
50+
- name: Run functional tests (Linux)
51+
if: runner.os == 'Linux'
52+
run: make test-functional
53+
54+
- name: Run functional tests (macOS)
55+
if: runner.os == 'macOS'
56+
run: make test-functional EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib" SQLITE="$SQLITE_PREFIX/bin/sqlite3"
57+
58+
rust-tests:
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
os: [ubuntu-latest, macos-latest]
63+
64+
runs-on: ${{ matrix.os }}
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Install Rust toolchain
70+
uses: dtolnay/rust-toolchain@stable
71+
72+
- name: Install dependencies (Linux)
73+
if: runner.os == 'Linux'
74+
run: |
75+
sudo apt-get update
76+
sudo apt-get install -y bison flex libsqlite3-dev
77+
78+
- name: Install dependencies (macOS)
79+
if: runner.os == 'macOS'
80+
run: |
81+
brew install bison flex sqlite
82+
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
83+
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
84+
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
85+
86+
- name: Build extension (Linux)
87+
if: runner.os == 'Linux'
88+
run: make extension
89+
90+
- name: Build extension (macOS)
91+
if: runner.os == 'macOS'
92+
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
93+
94+
- name: Run Rust tests
95+
working-directory: bindings/rust
96+
run: cargo test -- --test-threads=1
97+
98+
python-tests-linux:
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
python-version: ['3.9', '3.10', '3.11', '3.12']
103+
104+
runs-on: ubuntu-latest
105+
106+
steps:
107+
- uses: actions/checkout@v4
108+
109+
- name: Set up Python ${{ matrix.python-version }}
110+
uses: actions/setup-python@v5
111+
with:
112+
python-version: ${{ matrix.python-version }}
113+
114+
- name: Install dependencies
115+
run: |
116+
sudo apt-get update
117+
sudo apt-get install -y bison flex libsqlite3-dev
118+
119+
- name: Build extension
120+
run: make extension
121+
122+
- name: Install Python package
123+
working-directory: bindings/python
124+
run: pip install -e ".[dev]"
125+
126+
- name: Run Python tests
127+
working-directory: bindings/python
128+
run: pytest tests/ -v
129+
130+
python-tests-macos:
131+
runs-on: macos-latest
132+
133+
steps:
134+
- uses: actions/checkout@v4
135+
136+
- name: Install dependencies
137+
run: |
138+
brew install bison flex sqlite python@3.11
139+
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
140+
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
141+
echo "$(brew --prefix python@3.11)/libexec/bin" >> $GITHUB_PATH
142+
143+
- name: Build extension
144+
run: |
145+
HOMEBREW_PREFIX=$(brew --prefix)
146+
make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
147+
148+
- name: Install Python package
149+
run: |
150+
python3 -m pip install -e "./bindings/python[dev]"
151+
152+
- name: Run Python tests
153+
working-directory: bindings/python
154+
run: |
155+
SQLITE_PREFIX=$(brew --prefix sqlite)
156+
DYLD_LIBRARY_PATH="$SQLITE_PREFIX/lib:$DYLD_LIBRARY_PATH" python3 -m pytest tests/ -v

.github/workflows/release.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-extension:
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- os: ubuntu-latest
15+
artifact: graphqlite.so
16+
- os: macos-latest
17+
artifact: graphqlite.dylib
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Install dependencies (Linux)
25+
if: runner.os == 'Linux'
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y bison flex libsqlite3-dev
29+
30+
- name: Install dependencies (macOS)
31+
if: runner.os == 'macOS'
32+
run: |
33+
brew install bison flex sqlite
34+
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
35+
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
36+
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
37+
38+
- name: Build extension (Linux)
39+
if: runner.os == 'Linux'
40+
run: make extension
41+
42+
- name: Build extension (macOS)
43+
if: runner.os == 'macOS'
44+
run: make extension EXTRA_INCLUDES="-I$HOMEBREW_PREFIX/include" EXTRA_LIBS="-L$HOMEBREW_PREFIX/lib"
45+
46+
- name: Upload extension artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: extension-${{ matrix.os }}
50+
path: build/${{ matrix.artifact }}
51+
52+
publish-python:
53+
needs: build-extension
54+
runs-on: ubuntu-latest
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: '3.11'
63+
64+
- name: Install build tools
65+
run: pip install build twine
66+
67+
- name: Build source distribution
68+
working-directory: bindings/python
69+
run: python -m build --sdist
70+
71+
- name: Publish to PyPI
72+
working-directory: bindings/python
73+
env:
74+
TWINE_USERNAME: __token__
75+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
76+
run: twine upload dist/*
77+
78+
publish-rust:
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- name: Install Rust toolchain
85+
uses: dtolnay/rust-toolchain@stable
86+
87+
- name: Publish to crates.io
88+
working-directory: bindings/rust
89+
env:
90+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
91+
run: cargo publish --allow-dirty
92+
93+
create-release:
94+
needs: [build-extension, publish-python, publish-rust]
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- uses: actions/checkout@v4
99+
100+
- name: Download all artifacts
101+
uses: actions/download-artifact@v4
102+
with:
103+
path: artifacts
104+
105+
- name: Create GitHub Release
106+
uses: softprops/action-gh-release@v1
107+
with:
108+
files: |
109+
artifacts/extension-ubuntu-latest/*
110+
artifacts/extension-macos-latest/*
111+
generate_release_notes: true

.metis/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
metis.db
2+
metis-mcp-server.log

0 commit comments

Comments
 (0)