Skip to content

Commit 9f014bc

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 9f014bc

File tree

146 files changed

+22869
-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

+22869
-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: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
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+
- os: windows-latest
19+
artifact: graphqlite.dll
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Install dependencies (Linux)
27+
if: runner.os == 'Linux'
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y bison flex libsqlite3-dev
31+
32+
- name: Install dependencies (macOS)
33+
if: runner.os == 'macOS'
34+
run: |
35+
brew install bison flex sqlite
36+
echo "/opt/homebrew/opt/bison/bin" >> $GITHUB_PATH
37+
echo "/opt/homebrew/opt/flex/bin" >> $GITHUB_PATH
38+
39+
- name: Install dependencies (Windows)
40+
if: runner.os == 'Windows'
41+
uses: msys2/setup-msys2@v2
42+
with:
43+
msystem: UCRT64
44+
update: true
45+
install: mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-bison mingw-w64-ucrt-x86_64-flex mingw-w64-ucrt-x86_64-sqlite3
46+
47+
- name: Build extension (Linux/macOS)
48+
if: runner.os != 'Windows'
49+
run: make extension
50+
51+
- name: Build extension (Windows)
52+
if: runner.os == 'Windows'
53+
shell: msys2 {0}
54+
run: make extension
55+
56+
- name: Upload extension artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: extension-${{ matrix.os }}
60+
path: build/${{ matrix.artifact }}
61+
62+
publish-python:
63+
needs: build-extension
64+
runs-on: ubuntu-latest
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Set up Python
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: '3.11'
73+
74+
- name: Install build tools
75+
run: pip install build twine
76+
77+
- name: Build source distribution
78+
working-directory: bindings/python
79+
run: python -m build --sdist
80+
81+
- name: Publish to PyPI
82+
working-directory: bindings/python
83+
env:
84+
TWINE_USERNAME: __token__
85+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
86+
run: twine upload dist/*
87+
88+
publish-rust:
89+
runs-on: ubuntu-latest
90+
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Install Rust toolchain
95+
uses: dtolnay/rust-toolchain@stable
96+
97+
- name: Publish to crates.io
98+
working-directory: bindings/rust
99+
env:
100+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
101+
run: cargo publish --allow-dirty
102+
103+
create-release:
104+
needs: [build-extension, publish-python, publish-rust]
105+
runs-on: ubuntu-latest
106+
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Download all artifacts
111+
uses: actions/download-artifact@v4
112+
with:
113+
path: artifacts
114+
115+
- name: Create GitHub Release
116+
uses: softprops/action-gh-release@v1
117+
with:
118+
files: |
119+
artifacts/extension-ubuntu-latest/*
120+
artifacts/extension-macos-latest/*
121+
artifacts/extension-windows-latest/*
122+
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)