Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
681 commits
Select commit Hold shift + click to select a range
78326fc
cleanup
tobyhede Jan 27, 2025
9521fc2
Merge pull request #84 from cipherstash/fix-operators
tobyhede Jan 27, 2025
d79b4ee
WIP
tobyhede Jan 30, 2025
73d9926
Closer
tobyhede Jan 30, 2025
21c7448
Closer, but order is inverted (ASC is DESC etc)
tobyhede Jan 30, 2025
c16388c
eql ore fn returns bytea[]
tobyhede Feb 10, 2025
e14ea01
testing ore payload as bytea[]
tobyhede Feb 10, 2025
4a5075c
Ore index as JSONB array
tobyhede Feb 11, 2025
0f1422e
ORE operators
tobyhede Feb 14, 2025
add16f5
Order by ORE
tobyhede Feb 14, 2025
0c9ddaa
EQ tests with ORE
tobyhede Feb 14, 2025
7b93f1b
Ore is now array
tobyhede Feb 14, 2025
93b5e6a
Cleanup
tobyhede Feb 14, 2025
490249c
Expand ordering tests
tobyhede Feb 16, 2025
b435951
decode instead of cast bytea
tobyhede Feb 18, 2025
8114295
Explictly test sort order for all rows
tobyhede Feb 19, 2025
cf2a4a5
Use ore_64_8_index_v1 instead of bytea[]
tobyhede Feb 19, 2025
e27554c
Merge pull request #86 from cipherstash/operator-please
tobyhede Feb 19, 2025
f60583e
Use same drop setup on install and uninstall
tobyhede Feb 20, 2025
d58b0ce
Correct naming of ore_64_8_index_v1
tobyhede Feb 20, 2025
44d3745
Drop compare_ore_array(
tobyhede Feb 20, 2025
63f376c
Merge pull request #87 from cipherstash/improve-uninstall
tobyhede Feb 21, 2025
f707d09
Revert back to commit 01dcc24
CDThomas Feb 25, 2025
ce753f9
Merge pull request #89 from cipherstash/revert-ore-order-by-changes
CDThomas Feb 25, 2025
bbb50c1
Parse ORE indexes as JSON arrays of hex-encoded strings
CDThomas Feb 25, 2025
0a6af2d
Add explaining comment for `jsonb_array_to_ore_64_8_v1` function
CDThomas Feb 26, 2025
869ebe8
Merge pull request #90 from cipherstash/feat/parse-ore-as-json-array
CDThomas Feb 26, 2025
ff7a349
fix(ore): NULL comparisons should return NULL
tobyhede Mar 6, 2025
d7a7c8b
chore(ore): condense null logic
tobyhede Mar 6, 2025
434c7fc
Merge pull request #92 from cipherstash/fix-ore-null-comparison
tobyhede Mar 6, 2025
7da6fd3
Revert "fix(ore): NULL comparisons should return NULL"
tobyhede Mar 7, 2025
482e91e
Merge pull request #93 from cipherstash/revert-92-fix-ore-null-compar…
tobyhede Mar 7, 2025
aaa83de
fix(ore): return null when comparing null ore values
tobyhede Mar 10, 2025
69003bf
Merge pull request #94 from cipherstash/fix-ore-null
tobyhede Mar 11, 2025
ca97976
feat: Add cs_eql_version function and generate eql version from relea…
tobyhede Mar 11, 2025
2548303
Merge pull request #95 from cipherstash/add-version-function
tobyhede Mar 11, 2025
186d21c
fix: Use ~~ as match operator
tobyhede Mar 20, 2025
6efb59b
Merge pull request #96 from cipherstash/match-using-like-operators
tobyhede Mar 20, 2025
38d2bc4
chore: fix typo
yujiyokoo Apr 2, 2025
cd7aa7f
feat: implement cs_min_v1 and cs_max_v1
yujiyokoo Apr 2, 2025
65dd987
Merge pull request #97 from cipherstash/create-cs_min_v1-cs_max_v1-eq…
yujiyokoo Apr 2, 2025
7ae9595
feat: add schema definition
tobyhede Apr 11, 2025
5823a7b
feat(schema): schemify ore classic
tobyhede Apr 11, 2025
cab48e7
feat(schema): schemify ore cllw
tobyhede Apr 11, 2025
6937b7a
feat(schema): schemify ste_vec
tobyhede Apr 11, 2025
ba7c3b4
feat(schema): schemify core domain
tobyhede Apr 11, 2025
0b6eb0d
feat(schema): schemify core functions
tobyhede Apr 11, 2025
0e4e297
feat(schema) schemify eq
tobyhede Apr 11, 2025
c886ee0
feat(schema) schemify match
tobyhede Apr 11, 2025
3c93983
feat(schema) schemify ore operators
tobyhede Apr 11, 2025
1820ab7
feat(schema) schemify config schema
tobyhede Apr 11, 2025
1c2ae7f
feat(schema) schemify config fns
tobyhede Apr 11, 2025
6717523
feat(schema) schemify encryptindex
tobyhede Apr 11, 2025
868f64a
feat(schema) schemify aggregates
tobyhede Apr 11, 2025
12e1f63
feat(schema) schemify drops
tobyhede Apr 11, 2025
451399d
feat(schema) schemify tests
tobyhede Apr 11, 2025
ffd2ac2
fixes
tobyhede Apr 11, 2025
2082ff3
Merge pull request #98 from cipherstash/schemify-eql
tobyhede Apr 11, 2025
f74947f
Bump golang.org/x/crypto from 0.29.0 to 0.35.0 in /examples/go/xorm
dependabot[bot] Apr 14, 2025
31496b8
chore(examples): upgrade to latest stable golang
auxesis Apr 15, 2025
8b04564
Merge pull request #100 from cipherstash/dependabot/go_modules/exampl…
auxesis Apr 15, 2025
06b3892
chore: split sql into modules
tobyhede Apr 17, 2025
0579168
build: build with dependencies
tobyhede Apr 17, 2025
3785333
chore: delete original sql files
tobyhede Apr 17, 2025
5c39218
docs(dev): move all development docs into the development guide
auxesis Apr 17, 2025
b48ff3f
docs(dev): rework for clarity and readability
auxesis Apr 17, 2025
05a8d63
build: ensure tests are run on changes to new location
auxesis Apr 17, 2025
cc1b063
test: output better status
auxesis Apr 17, 2025
1c5e87c
Merge pull request #99 from cipherstash/eql-v2
tobyhede Apr 17, 2025
7f77dca
Encrypted JSONB operators and functions
tobyhede Apr 25, 2025
2810769
fix: remove old unused requires
tobyhede May 6, 2025
f9dd6eb
feat: -> operator with integer for array index
tobyhede May 6, 2025
72d38e5
chore: remove all drops and rely on drop schema
tobyhede May 6, 2025
9e92f81
fix: remove duplicated eql_v1.to_jsonb function
tobyhede May 6, 2025
42ebe68
fix: mise sources in build.sh
freshtonic May 6, 2025
21ba726
Merge pull request #101 from cipherstash/eql-v2-0-jsonb
tobyhede May 6, 2025
8f5c67d
Docs: Add issue template
kateandrews May 7, 2025
3655c6e
Docs: Add feedback link to end of README
kateandrews May 7, 2025
c2bec97
Docs: Add feedback link to end of WHY doc
kateandrews May 7, 2025
ac590bb
Docs: Add feedback link to end of INDEX doc
kateandrews May 7, 2025
50ce3e8
Docs: Add feedback link to JSON doc
kateandrews May 7, 2025
9642701
Docs: Add feedback link to MIGRATOR doc
kateandrews May 7, 2025
a3b27cc
Docs: Add feedback link to bottom of PAYLOAD doc
kateandrews May 7, 2025
1420003
Docs: Add feedback link to bottom of GETTINGSTARTED doc
kateandrews May 7, 2025
e381016
Docs: Add feedback link to bottom of PROXY doc
kateandrews May 7, 2025
76278ad
Merge pull request #102 from cipherstash/eql-docs-feedback
kateandrews May 7, 2025
14ed3fa
feat: order_by function to remove need to wrap as ore
tobyhede May 8, 2025
9d21566
chore:
tobyhede May 8, 2025
e99db91
docs: document working without operators for supabase
tobyhede May 8, 2025
7b0d785
fix: Drop test table
tobyhede May 8, 2025
3c74fa8
docs: Link to GitHub issue tracking Supabase support for custom opera…
auxesis May 8, 2025
514f234
docs: be more specific about how EQL is organised
auxesis May 8, 2025
e5cb31a
docs: highlight technical terms
auxesis May 8, 2025
a88e2e5
docs: make it clearer that the following example demonstrates how to …
auxesis May 8, 2025
d6f3eec
docs: syntax highlight SQL code blocks
auxesis May 8, 2025
4d5ebbc
docs: line per sentence, to improve maintainability
auxesis May 8, 2025
fc60fee
docs: highlight technical terms
auxesis May 8, 2025
34c3dbc
docs: link to supporting documentation
auxesis May 8, 2025
41a3b79
docs: reword for clarity
auxesis May 8, 2025
c6345f1
build: ensure all SQL files trigger tests
auxesis May 8, 2025
cfc38e2
Merge pull request #103 from cipherstash/orderby-function
tobyhede May 9, 2025
a51d35a
docs: add index term to layout
tobyhede May 9, 2025
aeb2da4
feat: encrypted column constraint on index_add
tobyhede May 14, 2025
581ab9b
Merge pull request #104 from cipherstash/encrypted-column-constraint
tobyhede May 14, 2025
d42dc89
fix: remove old cs_ prefix
tobyhede May 14, 2025
9f89889
chore: remove old files
tobyhede May 14, 2025
2a388c5
feat: EQL for supabase removing operator class and family
tobyhede May 15, 2025
9e21164
chore: Remove unneeded drop statements
tobyhede May 20, 2025
881e1b0
Merge branch 'main' into eql-v2-0
calvinbrewer May 20, 2025
c16b4eb
fix: comment uncommented code
calvinbrewer May 20, 2025
474eaa3
fix(tests): remove comments from json payload
calvinbrewer May 20, 2025
a036009
fix: supabase build release
calvinbrewer May 20, 2025
a446386
docs: update eql functions to v2
calvinbrewer May 20, 2025
a528674
feat: rename v1 to v2
calvinbrewer May 20, 2025
026907e
Merge pull request #105 from cipherstash/eql-v2-0
tobyhede May 21, 2025
3cd8dc9
refactor: rename add_index to add_search_term
tobyhede May 22, 2025
dc80ff7
Merge pull request #107 from cipherstash/rename-add-index-to-add-sear…
tobyhede May 22, 2025
3baf834
chore: Remove unused files and examples.
tobyhede May 22, 2025
418869b
Merge pull request #108 from cipherstash/cleanup
tobyhede May 22, 2025
209d775
feat: rename match to bloom_filter
tobyhede May 22, 2025
b735946
feat: remane blake3 field to b3
tobyhede May 22, 2025
a1d8e71
feat: rename ore_64_8_v2 to ore_block_u64_8_256
tobyhede May 22, 2025
5c852c8
feat: rename unique to hmac_256
tobyhede May 22, 2025
aae096a
feat: rename ore directory as well
tobyhede May 22, 2025
ee6adf9
feat: make it work
tobyhede May 22, 2025
1565139
Merge pull request #109 from cipherstash/rename-fields
tobyhede May 22, 2025
befe650
Merge pull request #109 from cipherstash/rename-fields
tobyhede May 22, 2025
951c281
docs: update SUPABASE.md formating
calvinbrewer May 22, 2025
2e587fb
Merge pull request #110 from cipherstash/calvinbrewer-patch-1
calvinbrewer May 22, 2025
db60204
fix: Increment EQL.json version and associated tests
tobyhede May 23, 2025
4f1578d
Merge pull request #111 from cipherstash/update-eql-json-version
tobyhede May 23, 2025
4dbf3cf
test: Expand ordering test using operator family
tobyhede May 27, 2025
ae704df
Merge pull request #112 from cipherstash/expand-order-by-testing
tobyhede May 29, 2025
11e8053
fix: correctly cast and handle nulls for order ops
tobyhede May 29, 2025
39e566b
Merge pull request #113 from cipherstash/encrypted-columns-with-expli…
tobyhede May 29, 2025
5e18515
fix: invalid use of perform
tobyhede May 30, 2025
f131f0c
Merge pull request #114 from cipherstash/remove-erroneous-perform
tobyhede May 30, 2025
6be919a
feat: -> and ->> variants with eql_v2_enctrypted selector
tobyhede Jun 3, 2025
c4b627c
fix: explicit cast to text for all tests using -> or ->>
tobyhede Jun 3, 2025
d3e5a7d
Merge pull request #115 from cipherstash/encrypted-stabby-selector-param
tobyhede Jun 3, 2025
f8f5de9
feat: encrypted_hmac_256_operator class
tobyhede Jun 6, 2025
ae0fd61
test: selects use indexes
tobyhede Jun 7, 2025
a09c575
feat: has_index functions
tobyhede Jun 13, 2025
f45dc1b
feat: add json functions that take encrypted
tobyhede Jun 17, 2025
020ced1
feat: add metadata to ste_vec records
tobyhede Jun 18, 2025
6d56789
Merge pull request #117 from cipherstash/jsonb-functions-take-eql_v1_…
tobyhede Jun 20, 2025
6306871
Merge pull request #116 from cipherstash/enable-index-on-hmac_256
tobyhede Jun 23, 2025
f0db83e
feat: compare_hmac_256
tobyhede Jun 23, 2025
1397fa0
feat: compare_blake3
tobyhede Jun 23, 2025
d780602
feat: compare_ore_block_u64_8_256
tobyhede Jun 24, 2025
268d977
feat: compare_ore_cllw_u64_8
tobyhede Jun 24, 2025
8d13707
feat: compare_ore_cllw_var_8
tobyhede Jun 24, 2025
a9adb97
feat: compare
tobyhede Jun 24, 2025
d4d9a07
feat: compare literal
tobyhede Jun 24, 2025
44d05e5
refactor: operators use compare function
tobyhede Jun 24, 2025
41ece0d
refactor: operator class
tobyhede Jun 24, 2025
a86abf6
fix: disable ore_cllw operators
tobyhede Jun 24, 2025
d0fae6b
fix: remove errant raise notice
tobyhede Jun 24, 2025
1396825
test: index usage
tobyhede Jun 24, 2025
2fe1416
chore: cleanup
tobyhede Jun 24, 2025
cf19a91
test: index test less brittle
tobyhede Jun 25, 2025
ebebac8
test: separate <= tests for ore cllw
tobyhede Jun 25, 2025
9dc905b
test: group by
tobyhede Jun 25, 2025
2d348b2
Merge pull request #118 from cipherstash/enable-index-on-hmac_256
tobyhede Jun 25, 2025
af07fa1
feat: zero downtime migration workflow optional
tobyhede Jun 26, 2025
fff948e
Merge pull request #119 from cipherstash/remove-zero-downtime-migrati…
tobyhede Jun 29, 2025
26a8eae
fix: jsonb accessors return with metadata
tobyhede Jul 8, 2025
ee12088
Merge pull request #120 from cipherstash/jsonb-field-access-with-meta…
tobyhede Jul 8, 2025
b5f061c
fix: drop eql schema on install
tobyhede Jul 8, 2025
f967e57
Merge pull request #121 from cipherstash/drop-schema-on-install
auxesis Jul 9, 2025
4242621
fix: treat single element ste vec as eql_v2_encrypted
tobyhede Jul 9, 2025
a937160
docs: revamp docs
calvinbrewer Jul 13, 2025
7750313
feat: released 2.1.2 to dbdev
calvinbrewer Jul 13, 2025
87bc9a6
docs: dbdev readme symlink
calvinbrewer Jul 13, 2025
b5051bf
Update tasks/postgres.toml
calvinbrewer Jul 14, 2025
02deb18
Update tasks/build.sh
calvinbrewer Jul 14, 2025
5576237
Update README.md
calvinbrewer Jul 14, 2025
b98036e
Update README.md
calvinbrewer Jul 14, 2025
5831972
Merge pull request #123 from cipherstash/docs-revamp
calvinbrewer Jul 14, 2025
2e085b8
fix: config functions remove process
calvinbrewer Jul 15, 2025
0178156
chore: update tests to new config behavior
calvinbrewer Jul 15, 2025
7084c66
fix: remove empty state and troubleshooting docs
calvinbrewer Jul 15, 2025
cc8a8a4
Update proxy-configuration.md
calvinbrewer Jul 15, 2025
2de075c
Update proxy-configuration.md
calvinbrewer Jul 15, 2025
dfea043
Merge pull request #124 from cipherstash/fix-remvoe
calvinbrewer Jul 15, 2025
ee2ea10
Merge pull request #122 from cipherstash/ste-vec-item-as-encrypted
tobyhede Jul 21, 2025
8a22f23
fix: add meta to jsonb_array_elements
tobyhede Jul 23, 2025
da88b35
fix: ->> as alias for ->
tobyhede Jul 23, 2025
db9e065
Merge pull request #125 from cipherstash/proxy-integration-fixes
tobyhede Jul 23, 2025
6ac54bc
fix: make min & max delegate to comparison ops directly
freshtonic Jul 28, 2025
46234d2
Merge pull request #126 from cipherstash/fix/delegate-max-min-to-compare
freshtonic Jul 28, 2025
424df54
fix: make eql_v2.compare robust against null search terms
freshtonic Jul 29, 2025
5d55daf
test: test for handling of null index terms
tobyhede Jul 29, 2025
6540000
Merge pull request #127 from cipherstash/fix/check-encrypted-search-t…
calvinbrewer Jul 29, 2025
9d5b84a
fix: add immutable to cast functions
tobyhede Jul 31, 2025
57b2457
fix: make spacing consistent
tobyhede Jul 31, 2025
b5c4fe8
test: add test for no index case
tobyhede Jul 31, 2025
3c5a71c
Merge pull request #128 from cipherstash/fix/cast-for-indexing
tobyhede Jul 31, 2025
13c97f8
docs: eql components
tobyhede Aug 11, 2025
bc36dab
ci: call multitudes deploy API
tobyhede Aug 19, 2025
c6ff8c6
Merge pull request #130 from cipherstash/multitudes-deploy-api
tobyhede Aug 19, 2025
349384a
docs: database permissions
tobyhede Aug 21, 2025
c59e1d6
Merge pull request #129 from cipherstash/docs/eql-components
tobyhede Aug 21, 2025
4828c21
feat(ci): release 2.1.8 to dbdev
calvinbrewer Sep 8, 2025
1ae6cde
Merge pull request #132 from cipherstash/dbdev-2-1-8
calvinbrewer Sep 8, 2025
0e29e4a
docs: add comprehensive function reference and index documentation
tobyhede Oct 13, 2025
70e1a18
docs: rewrite JSON/JSONB support documentation
tobyhede Oct 13, 2025
3744f34
docs: fix function names and operator usage in reference docs
tobyhede Oct 13, 2025
06a46f7
docs: enhance main README with getting started and troubleshooting
tobyhede Oct 13, 2025
c93aa09
docs: update DEVELOPMENT.md with SQL development guidelines
tobyhede Oct 13, 2025
5b56bb0
docs: comprehensive update to EQL function reference
tobyhede Oct 13, 2025
a40f9da
docs: fix inaccuracies in EQL function reference
tobyhede Oct 20, 2025
8dfc092
Merge pull request #133 from cipherstash/update-docs
tobyhede Oct 20, 2025
6f85616
feat(test): add pgTAP testing infrastructure
tobyhede Oct 22, 2025
9d7af2f
docs: enhance Rust test framework POC plan with review recommendations
tobyhede Oct 23, 2025
f41981a
docs: add comprehensive plan for SQL Doxygen documentation
tobyhede Oct 24, 2025
92b36cd
docs(sql): add documentation standards, templates, and tooling (Phase 1)
tobyhede Oct 27, 2025
9416206
docs(sql): document config module and core types (Phase 2 checkpoint)
tobyhede Oct 27, 2025
c889ae9
docs(sql): document encrypted functions and comparison operators (Pha…
tobyhede Oct 27, 2025
2b21ac2
docs(sql): document <= comparison operator (Phase 2 checkpoint 3)
tobyhede Oct 27, 2025
736d20b
docs(sql): update plan with execution strategy details
tobyhede Oct 27, 2025
adbae17
docs(sql): document comparison operators (>, >=, <>)
tobyhede Oct 27, 2025
33c23e5
docs(operators): complete Phase 2 - document JSONB and support functions
tobyhede Oct 27, 2025
1e48ebb
docs(operators): clarify ->> alias semantics
tobyhede Oct 27, 2025
2231b2e
docs(config): align modify_search_config throws
tobyhede Oct 27, 2025
4152db0
docs(sql): add Doxygen comments to hash and bloom filter index module…
tobyhede Oct 27, 2025
a862007
docs(sql): add Doxygen comments to ORE block module (Phase 3 batch 2)
tobyhede Oct 27, 2025
1fa519b
docs(sql): add Doxygen comments to remaining ORE and STE modules (Pha…
tobyhede Oct 27, 2025
5005296
docs(sql): standardize JSONB parameter descriptions
tobyhede Oct 27, 2025
6f73596
chore(sql): remove disabled ORE block operator files
tobyhede Oct 27, 2025
1642d2f
Revert "chore(sql): remove disabled ORE block operator files"
tobyhede Oct 27, 2025
244c525
docs(sql): add Doxygen comments to Phase 4 modules
tobyhede Oct 27, 2025
741bebe
docs(sql): fix Phase 4 documentation clarity issues
tobyhede Oct 27, 2025
d2b8fba
docs(sql): add comprehensive Doxygen comments to Phase 4 modules
tobyhede Oct 27, 2025
ad95f34
docs(sql): improve Phase 4 Doxygen documentation clarity
tobyhede Oct 27, 2025
ba2d50e
docs(sql): fix 'v' field documentation inconsistency in count_encrypt…
tobyhede Oct 27, 2025
d4c2257
docs(sql): add Doxygen comments to version template
tobyhede Oct 28, 2025
01ab2f8
docs(sql): ensure Doxygen comments included in generated version.sql
tobyhede Oct 28, 2025
ee96e15
docs: add Doxygen documentation standards to CLAUDE.md
tobyhede Oct 28, 2025
1264b71
ci: add documentation validation to test workflow
tobyhede Oct 28, 2025
2e53216
docs: add Doxygen configuration file
tobyhede Oct 28, 2025
5e37aca
docs: add Documentation section to README
tobyhede Oct 28, 2025
e8debb0
docs: add mise tasks for documentation generation and validation
tobyhede Oct 28, 2025
30cf768
fix(docs): resolve Doxygen generation issues
tobyhede Oct 28, 2025
b97fd6f
fix(ci): use mise tasks for documentation validation
tobyhede Oct 28, 2025
b4d6b4d
docs(sql): fix documentation validation errors
tobyhede Oct 28, 2025
a398dc8
ci: install rust
tobyhede Oct 29, 2025
4ecfa67
Merge phase-4-doxygen infrastructure into continue-doxygen-sql-comments
tobyhede Oct 29, 2025
d3d4a28
Add documentation tasks to mise.toml
tobyhede Oct 29, 2025
941a6c6
docs: update plan to reflect completed infrastructure merge
tobyhede Oct 29, 2025
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
9 changes: 9 additions & 0 deletions .github/workflows/test-eql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install rust
shell: /bin/bash -l {0}
run: rustup toolchain install stable --profile minimal --no-self-update

- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true

- uses: jdx/mise-action@v2
with:
version: 2025.1.6 # [default: latest] mise version to install
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,4 @@ release/
__pycache__

# dbdev
eql--*.sql

# Generated SQLx migration (built from src/, never commit)
tests/sqlx/migrations/001_install_eql.sql
eql--*.sql
81 changes: 81 additions & 0 deletions 2025-10-27-phase-4-review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Code Review - Phase 4 Documentation (2025-10-27)

## Status: APPROVED

## BLOCKING (Must Fix Before Merge)

None

## NON-BLOCKING (May Be Deferred)

**Minor: version.sql file header inconsistency:**
- Description: The file header says "AUTOMATICALLY GENERATED FILE" but we manually added Doxygen comments to it. The comments should clarify that while the version string is auto-generated, the documentation is maintained manually.
- Location: src/version.sql:1-12
- Action: Consider adding a note: `@note Version string auto-generated at build time, documentation maintained manually`

## Highlights

**Comprehensive and Systematic Documentation:**
- What: Added Doxygen documentation to 32 files across Phase 4 with consistent structure and formatting. Every function includes `@brief`, appropriate parameter documentation, return value description, and relevant notes.
- Location: All Phase 4 files (encrypted/, config/, jsonb/, encryptindex/, root utilities)

**Excellent Use of Cross-References:**
- What: Documentation includes `@see` tags linking related functions, creating a navigable documentation graph
- Location: Examples in src/config/constraints.sql:151-154 (comprehensive CHECK constraint with @see references to all validation functions)

**Clear Distinction of Internal vs Public APIs:**
- What: Consistent use of `@internal` tags to mark implementation details vs customer-facing functions
- Location: All constraint validation functions properly marked internal (src/config/constraints.sql), while customer-facing functions like `jsonb_path_query` include examples

**Practical Examples for Customer-Facing Functions:**
- What: Customer-facing functions include concrete `@example` sections showing actual usage
- Location: src/jsonb/functions.sql:117-119 (jsonb_path_query example), src/config/constraints.sql:121-123 (check_encrypted constraint example)

**Context-Rich Documentation:**
- What: `@note` tags provide important context about behavior, usage patterns, and edge cases
- Location: src/common.sql:24 (constant-time comparison security note), src/config/indexes.sql:12 (explains partial index efficiency)

**File-Level Documentation:**
- What: Each module includes comprehensive `@file` documentation explaining the module's purpose and what it contains
- Location: src/jsonb/functions.sql:4-14, src/encryptindex/functions.sql:1-11

## Test Results
- Status: **PASS** βœ…
- Details: All 40+ test files passed successfully. Build completed without errors.
```
###############################################
# βœ…ALL TESTS PASSED
###############################################
```

## Check Results
- Status: Not run (no `mise run check` task in this project)
- Details: N/A - project uses tests only for verification

## Summary

Phase 4 documentation work adds 718 lines of high-quality Doxygen comments (+555 net lines) across 13 critical SQL files:

**Documented Modules:**
- **Operators Infrastructure** (3 files): compare.sql, order_by.sql, operator_class.sql
- **Encrypted Supporting Files** (4 files): aggregates.sql, casts.sql, compare.sql, constraints.sql
- **JSONB Functions** (15 functions): Path query operations and array manipulation
- **Config Schema** (4 files): types.sql, tables.sql, indexes.sql, constraints.sql
- **Encryptindex Functions** (7 functions): Configuration lifecycle management
- **Root Utilities** (4 files): common.sql, crypto.sql, schema.sql, version.sql

**Quality Indicators:**
- βœ… Consistent Doxygen formatting across all files
- βœ… Appropriate use of tags (@brief, @param, @return, @throws, @note, @see, @internal, @example)
- βœ… Clear distinction between internal and public APIs
- βœ… Practical examples for customer-facing functions
- βœ… Cross-references create navigable documentation
- βœ… File-level documentation provides module context
- βœ… All tests pass - documentation doesn't break functionality
- βœ… No security or correctness issues introduced

## Next Steps

1. βœ… Review complete - APPROVED
2. Commit Phase 4 documentation with conventional commit message
3. Continue to Phase 5 (if applicable) or complete documentation project
148 changes: 148 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Development Commands

This project uses `mise` for task management. Common commands:

- `mise run build` (alias: `mise r b`) - Build SQL into single release file
- `mise run test` (alias: `mise r test`) - Build, reset and run tests
- `mise run postgres:up` - Start PostgreSQL container
- `mise run postgres:down` - Stop PostgreSQL containers
- `mise run reset` - Reset database state
- `mise run clean` (alias: `mise r k`) - Clean release files
- `mise run docs:generate` - Generate API documentation (requires doxygen)
- `mise run docs:validate` - Validate documentation coverage and tags

### Testing
- Run all tests: `mise run test`
- Run specific test: `mise run test --test <test_name>`
- Run tests against specific PostgreSQL version: `mise run test --postgres 14|15|16|17`
- Tests are located in `*_test.sql` files alongside source code

### Build System
- Dependencies are resolved using `-- REQUIRE:` comments in SQL files
- Build outputs to `release/` directory:
- `cipherstash-encrypt.sql` - Main installer
- `cipherstash-encrypt-supabase.sql` - Supabase-compatible installer
- `cipherstash-encrypt-uninstall.sql` - Uninstaller

## Project Architecture

This is the **Encrypt Query Language (EQL)** - a PostgreSQL extension for searchable encryption. Key architectural components:

### Core Structure
- **Schema**: All EQL functions/types are in `eql_v2` PostgreSQL schema
- **Main Type**: `eql_v2_encrypted` - composite type for encrypted columns (stored as JSONB)
- **Configuration**: `eql_v2_configuration` table tracks encryption configs
- **Index Types**: Various encrypted index types (blake3, hmac_256, bloom_filter, ore variants)

### Directory Structure
- `src/` - Modular SQL components with dependency management
- `src/encrypted/` - Core encrypted column type implementation
- `src/operators/` - SQL operators for encrypted data comparisons
- `src/config/` - Configuration management functions
- `src/blake3/`, `src/hmac_256/`, `src/bloom_filter/`, `src/ore_*` - Index implementations
- `tasks/` - mise task scripts
- `tests/` - Test files (PostgreSQL 14-17 support)
- `release/` - Generated SQL installation files

### Key Concepts
- **Dependency System**: SQL files declare dependencies via `-- REQUIRE:` comments
- **Encrypted Data**: Stored as JSONB payloads with metadata
- **Index Terms**: Transient types for search operations (blake3, hmac_256, etc.)
- **Operators**: Support comparisons between encrypted and plain JSONB data
- **CipherStash Proxy**: Required for encryption/decryption operations

### Testing Infrastructure
- Tests run against PostgreSQL 14, 15, 16, 17 using Docker containers
- Container configuration in `tests/docker-compose.yml`
- Test helpers in `tests/test_helpers.sql`
- Database connection: `localhost:7432` (cipherstash/password)
- **Rust/SQLx Tests**: Modern test framework in `tests/sqlx/` (see README there)

## Project Learning & Retrospectives

Valuable lessons and insights from completed work:

- **SQLx Test Migration (2025-10-24)**: See `docs/retrospectives/2025-10-24-sqlx-migration-retrospective.md`
- Migrated 40 SQL assertions to Rust/SQLx (100% coverage)
- Key insights: Blake3 vs HMAC differences, batch-review pattern effectiveness, coverage metric definitions
- Lessons: TDD catches setup issues, infrastructure investment pays off, code review after each batch prevents compound errors

## Documentation Standards

### Doxygen Comments

All SQL functions and types must be documented using Doxygen-style comments:

- **Comment Style**: Use `--!` prefix for Doxygen comments (not `--`)
- **Required Tags**:
- `@brief` - Short description (required for all functions/files)
- `@param` - Parameter description (required for functions with parameters)
- `@return` - Return value description (required for functions with non-void returns)
- **Optional Tags**:
- `@throws` - Exception conditions
- `@note` - Important notes or caveats
- `@warning` - Warning messages (e.g., for DDL-executing functions)
- `@see` - Cross-references to related functions
- `@example` - Usage examples
- `@internal` - Mark internal/private functions
- `@file` - File-level documentation

### Documentation Example

```sql
--! @brief Create encrypted index configuration
--!
--! Initializes a new encrypted index configuration for a table column.
--! The configuration tracks encryption settings and index types.
--!
--! @param p_table_name text Table name (schema-qualified)
--! @param p_column_name text Column name to encrypt
--! @param p_index_type text Type of encrypted index (blake3, hmac_256, etc.)
--!
--! @return uuid Configuration ID for the created index
--!
--! @throws unique_violation If configuration already exists for this column
--!
--! @note This function executes DDL and modifies database schema
--! @see eql_v2.activate_encrypted_index
--!
--! @example
--! -- Create blake3 index configuration
--! SELECT eql_v2.create_encrypted_index(
--! 'public.users',
--! 'email',
--! 'blake3'
--! );
CREATE FUNCTION eql_v2.create_encrypted_index(...)
```

### Validation Tools

Verify documentation quality:

```bash
# Using mise (recommended - validates coverage and tags)
mise run docs:validate

# Or run individual scripts directly
tasks/check-doc-coverage.sh # Check 100% coverage
tasks/validate-required-tags.sh # Verify @brief, @param, @return tags
tasks/validate-documented-sql.sh # Validate SQL syntax (requires database)
```

### Template Files

Template files (e.g., `version.template`) must be documented. The Doxygen comments are automatically included in generated files during build.

## Development Notes

- SQL files are modular - put operator wrappers in `operators.sql`, implementation in `functions.sql`
- All SQL files must have `-- REQUIRE:` dependency declarations
- Test files end with `_test.sql` and live alongside source files
- Build system uses `tsort` to resolve dependency order
- Supabase build excludes operator classes (not supported)
- **Documentation**: All functions/types must have Doxygen comments (see Documentation Standards above)
Loading
Loading