Declarative vector/full-text/hybrid search, at-rest encryption docs, plural table names#1
Merged
Merged
Conversation
UsePluralTableNames + RegisterPlural: when enabled, the default (no-TableName) table name is pluralized snake_case (User -> users, Category -> categories), matching gorm. Off by default; an explicit TableName() always wins. A dependency-free inflector lives in internal/scan, and the toggle routes through scan.TableNameOf so the query and orm front-ends agree.
sqlite.WhereRegex(column, pattern) returns a WHERE fragment that pairs a GLOB prefix with REGEXP for anchored patterns (index range scan + residual filter), falling back to a plain REGEXP for unanchored ones. Requires the gosqlite regexp extension to be registered.
Declare search indexes on a model (a SearchIndexes() method or vec:/fts: tags); AutoMigrate provisions the FTS5/vec0 sidecars and keeps them current via SQL triggers (all writes) or ORM hooks (sidecar-only embeddings). Search through search.For[T](db).Vector/FullText/Hybrid, returning models in ranked order — int64 and string keys for vectors, int64-only for full-text. Adds the dialect SearchProvisioner/SearchRowSyncer capabilities over a neutral SearchSpec, the sqlite DDL + trigger/row-sync generation, and the typed searcher. Folds in the cleanup entangled in the same files: the hook handle Op -> Event, removal of the unused Queryer interface, a single SearchKind enum (dialect.SearchKind), Load -> Fetch on the search read path, and inlining of one-line stdlib wrappers.
Add a dedicated encryption example (open with a key, ciphertext on disk, reopen, reject the wrong key), guide, and skill, and surface encryption in the README, docs index, and skills index — moving it out of the search docs where it had been mis-bundled. examples/encryption is registered in go.work.
0a40bb9 to
d84e85f
Compare
ditalini
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vec:/fts:/fts5:struct tags or aSearchIndexes()method. Newdialect.SearchProvisioner/SearchRowSyncercapabilities emit the DDL/sync SQL, sodialectstays free of orm/session deps. Trigger-sync (all writes) and hook-sync (ORM writes only); FTS5 external-content + vec0 sidecars. Typed front-end:search.For[T](db).Vector/FullText/Hybrid(...).sqlite.OpenEncrypted(pure-Go Adiantum cipher, no CGo); surfaced in README + comparison table.orm.UsePluralTableNames(true)+RegisterPlural, via a dependency-free inflector shared by orm and query.WhereRegex— index-friendly regex filter (GLOB prefix + REGEXP fallback).Some breaking changes
orm.Op[T]→orm.Event[T]KNN/Match/Fuse→search.For[T](db)builder (.Vector/.FullText/.Hybrid)search.Load/LoadScored→Fetch/FetchScoredorm.SearchKinddropped;orm.SearchIndex.Kindnow usesdialect.SearchKindQueryerinterface removed