Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
249a9ed
feat (cypher): port v2 query builder
zinic May 7, 2026
db03b7b
feat(query/v2): materialize builder parameters
zinic May 7, 2026
f47a5c2
fix(query/v2): infer match patterns by query scope
zinic May 7, 2026
f656bc0
feat(query/v2): add typed projection and order helpers
zinic May 7, 2026
39aa3fc
feat(query/v2): add query helper parity
zinic May 7, 2026
f6488eb
test(query/v2): cover backend preparation paths
zinic May 7, 2026
b014b79
test(pgsql): exercise translator with v2 builder
zinic May 7, 2026
b7cc778
fix(query/v2): surface helper validation errors
zinic May 7, 2026
e61f4a8
fix(query/v2): preserve updating clause order
zinic May 7, 2026
a73d49a
feat(query/v2): support scoped pattern aliases
zinic May 7, 2026
ec02419
test(query/v2): assert backend render output
zinic May 7, 2026
318555d
fix(pgsql): reject unsupported create translation
zinic May 7, 2026
0f92ca8
fix(query/v2): reject unsupported relationship directions
zinic May 7, 2026
48b4aac
fix(query/v2): validate create qualified expressions
zinic May 7, 2026
3ad2e56
fix(query/v2): make kind projections scope aware
zinic May 7, 2026
2894033
fix(query/v2): ignore projection aliases for match inference
zinic May 7, 2026
961e601
fix(query/v2): validate explicit relationship directions
zinic May 7, 2026
0eb6945
fix(query/v2): validate scope aliases
zinic May 7, 2026
ddf6853
fix(query/v2): validate raw projection inputs
zinic May 7, 2026
e333c64
chore(query/v2): remove unused extractor state
zinic May 7, 2026
0eb36b3
fix(query/v2): sort property update keys
zinic May 7, 2026
8676196
fix(query/v2): validate raw mutation inputs
zinic May 7, 2026
00b855e
fix(query/v2): validate alias symbols
zinic May 7, 2026
fa5a4f5
fix (query/v2): named parameter fixups; preserve projection metadata;…
zinic May 8, 2026
6134427
fix (query/v2): clean up some poorly supported neo4j constructs
zinic May 8, 2026
d36a214
fix(query/v2): copy caller AST before build
zinic May 10, 2026
5ad5ad3
fix(query/v2): support explicit create endpoints
zinic May 10, 2026
2d82eb8
fix(query/v2): validate pagination bounds
zinic May 10, 2026
9192bed
fix(query/v2): reject empty logical helpers
zinic May 10, 2026
ecbd423
fix(query/v2): require relationship shortest paths
zinic May 10, 2026
b3a26cc
test(query/v2): cover legacy query parity
zinic May 10, 2026
1749b29
Fix query v2 aliased projection inference
zinic May 10, 2026
e6a1999
Fix query v2 qualified value expressions
zinic May 10, 2026
6381046
Validate query v2 delete targets
zinic May 10, 2026
a7db069
Preserve query v2 relationship kind conjunctions
zinic May 10, 2026
72e33ee
Infer query v2 raw return metadata identifiers
zinic May 10, 2026
5aabfb6
Reject query v2 path delete targets
zinic May 10, 2026
994a1fc
Address query v2 review feedback
zinic May 10, 2026
ad2fe55
Reject unbound query v2 identifiers
zinic May 10, 2026
292af2d
Add query v2 recursive traversal depth
zinic May 10, 2026
dcebd3a
test: cover v2 logical precedence
zinic May 10, 2026
fb2c5a3
fix: preserve v2 logical precedence
zinic May 10, 2026
fa5ede4
chore: streamline v2 build validation
zinic May 10, 2026
c79ed9c
refactor: return concrete v2 mutation types
zinic May 10, 2026
62cd5bc
fix: accept unicode cypher symbols
zinic May 10, 2026
54bae60
chore: harden v2 helper edges
zinic May 10, 2026
0d0a059
fix: preserve and grouping inside v2 or
zinic May 10, 2026
67e1e81
fix: support undirected relationship patterns
zinic May 10, 2026
e44205e
fix: validate v2 sort and split creates
zinic May 10, 2026
a89d481
feat: add benchmark report formats
zinic May 11, 2026
22baa58
feat: add benchmark diff harness
zinic May 11, 2026
ee9fdd9
feat: summarize benchmark diff findings
zinic May 11, 2026
d97dffa
feat: validate benchmark scenario row counts
zinic May 11, 2026
2a6b6a8
feat: add traversal shape benchmarks
zinic May 11, 2026
f847ea6
feat: include all benchmark numbers in diff report
zinic May 11, 2026
5e47dc7
Merge remote-tracking branch 'upstream/main' into query-v2
zinic May 19, 2026
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
# Local integration test datasets
integration/testdata/local/

# Local benchmark comparison output
.bench/

# Local test and metric artifacts
.coverage/
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST))
# Go configuration
GO_CMD ?= go
CGO_ENABLED ?= 0
BENCH ?= .
BENCH_COUNT ?= 10
BENCH_TIME ?= 1s
BENCH_BASE ?= main
BENCH_TARGET ?= HEAD
BENCH_KIND ?= all

# Main packages to test/build
MAIN_PACKAGES := $(shell $(GO_CMD) list ./...)
Expand Down Expand Up @@ -92,6 +98,14 @@ test_integration:
@echo "Running all integration tests..."
@$(GO_CMD) test -tags 'manual_integration integration' -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES)

test_bench:
@echo "Running benchmarks..."
@$(GO_CMD) test -run '^$$' -bench '$(BENCH)' -benchmem -count=$(BENCH_COUNT) -benchtime=$(BENCH_TIME) $(MAIN_PACKAGES)

bench_diff:
@echo "Running benchmark diff..."
@$(GO_CMD) run ./cmd/benchdiff --base '$(BENCH_BASE)' --target '$(BENCH_TARGET)' --kind '$(BENCH_KIND)' --bench '$(BENCH)' --bench-count '$(BENCH_COUNT)' --benchtime '$(BENCH_TIME)' $(BENCHDIFF_ARGS)

test_neo4j:
@echo "Running Neo4j integration tests..."
@$(GO_CMD) test -tags integration -race -cover -count=1 -p=1 -parallel=1 $(MAIN_PACKAGES)
Expand Down Expand Up @@ -216,6 +230,7 @@ help:
@echo " test_all - Run all tests including integration tests"
@echo " test_integration - Run all integration tests"
@echo " test_bench - Run benchmark test"
@echo " bench_diff - Compare benchmarks between commits"
@echo " test_neo4j - Run Neo4j integration tests"
@echo " test_pg - Run PostgreSQL integration tests"
@echo " test_update - Update test cases"
Expand Down
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,35 @@ export CONNECTION_STRING="neo4j://neo4j:weneedbetterpasswords@localhost:7687"

Use `make test` for unit tests only and `make test_integration` for integration tests only.

### Benchmarking

Run the package benchmark suite with:

```bash
make test_bench
```

Use `cmd/benchdiff` to compare benchmarks between two committed refs without changing the active worktree:

```bash
go run ./cmd/benchdiff -base main -target HEAD -kind unit
```

For integration benchmark comparisons, provide the same `CONNECTION_STRING` used by integration tests:

```bash
export CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs"
go run ./cmd/benchdiff -base main -target HEAD -kind all -driver pg -fail-regression 10%
```

The harness writes raw outputs and a Markdown report under `.bench/runs/` by default. The report begins with comparison
findings, includes the raw `benchstat` output for each benchmark suite, and ends with a table of all captured benchmark
numbers.

The integration benchmark runner includes committed `base` and `traversal_shapes` datasets by default. The traversal
shape suite checks expected result counts for chain, fanout, bounded cycle, disconnected, edge-kind-selective, and
multi-path shortest-path scenarios before recording timings.

### Test Metrics

`make test` writes unit test coverage artifacts under `.coverage/`:
Expand Down
52 changes: 52 additions & 0 deletions cmd/benchdiff/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Benchdiff

Compares the existing benchmark suites between two committed git refs without changing the active worktree.

## Usage

```bash
# Unit Go benchmarks only
go run ./cmd/benchdiff -base main -target HEAD -kind unit

# Unit and integration benchmarks
export CONNECTION_STRING="postgresql://dawgs:weneedbetterpasswords@localhost:65432/dawgs"
go run ./cmd/benchdiff -base main -target HEAD -kind all -driver pg

# Fail if a benchmark median regresses by more than 10%
go run ./cmd/benchdiff -base main -target HEAD -kind unit -fail-regression 10%
```

`benchdiff` creates detached worktrees under `.bench/`, runs each selected benchmark suite, writes raw output, and
produces a Markdown report. The report starts with comparison findings, including median regressions, improvements,
unchanged counts, and benchmark names that only appeared in one ref. It ends with an `All Executed Benchmark Numbers`
section that lists the median, percent change, and sample counts for every benchmark captured in either ref. Worktrees
are removed by default after the run; pass `-keep-worktrees` to preserve them.

## Flags

| Flag | Default | Description |
|------|---------|-------------|
| `-base` | `main` | Base git ref |
| `-target` | `HEAD` | Target git ref |
| `-kind` | `all` | Benchmark kind (`all`, `unit`, `integration`) |
| `-packages` | `./...` | Package list for Go benchmarks |
| `-bench` | `.` | Go benchmark regexp |
| `-bench-count` | `10` | Go benchmark repetition count |
| `-benchtime` | `1s` | Go benchmark benchtime |
| `-driver` | `pg` | Integration benchmark database driver |
| `-connection` | | Integration connection string (or `CONNECTION_STRING`) |
| `-dataset` | | Run only this integration dataset |
| `-local-dataset` | | Add a local integration dataset |
| `-dataset-dir` | `integration/testdata` | Integration testdata directory |
| `-integration-iterations` | `10` | Timed iterations per integration scenario |
| `-out` | `.bench/runs/<base>..<target>-<timestamp>` | Output directory |
| `-benchstat` | `auto` | `benchstat` command, `auto`, or `none` |
| `-fail-regression` | `0` | Median regression percentage that fails the command |
| `-keep-worktrees` | `false` | Preserve temporary worktrees |

If `benchstat` is not on `PATH` and `-benchstat auto` is used, the harness falls back to
`go run golang.org/x/perf/cmd/benchstat@latest`.

Integration comparisons use native `cmd/benchmark -format benchfmt` when both refs support it. If either ref predates
that flag, the harness runs both refs in Markdown compatibility mode and compares each scenario's median as a single
`ns/op` sample.
Loading
Loading