Files
zeekayandGitHub 3206f5140c store: the engine runs on PostgreSQL (hanzo-sql) as well as SQLite (#3)
A host that keeps its stores on a server passes Config.Postgres with the handle it opens.
The engine then writes numbered placeholders, keeps a document's data in JSONB, migrates
in one transaction under an advisory lock (CREATE TABLE IF NOT EXISTS is not safe against
itself), reads the schema from information_schema, and leaves the pragmas and the single
connection to the host. SQLite is unchanged: ? placeholders, a text column, the same DDL.

Both engines use ->> to look inside a document (CAST(data->>? AS TEXT)), where SQLite had
json_extract; times and counters are BIGINT; docstatus filters are typed for the column;
the series upsert names its table (the column was ambiguous); a lock or series key, which
joins its parts with NUL, is stored in hex on PostgreSQL, which cannot hold NUL in text.

Testing: the whole suite runs on both engines. FRAMEWORK_TEST_POSTGRES_DSN names a server;
each test gets a schema of its own. go test ./... passes on SQLite and on a throwaway
PostgreSQL 16, 0 failures on either.
Risk: a custom sort field now orders as text on SQLite too (it was the native JSON type);
doctype, document, naming and lock behaviour is unchanged on SQLite (suite green).
How to revert: git revert this commit.

Claude-Session: https://claude.ai/code/session_015XYKLn69gF4x75RWePpDBV
2026-11-21 00:17:43 -08:00

56 lines
2.2 KiB
AMPL

module github.com/hanzoai/framework
go 1.26.8
require (
github.com/hanzoai/doctype v0.1.5
github.com/hanzoai/sqlite v0.4.0
github.com/jackc/pgx/v5 v5.13.0
github.com/luxfi/log v1.6.0
)
require (
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/circl v1.6.3 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 // indirect
github.com/grandcat/zeroconf v1.0.0 // indirect
github.com/hanzoai/csqlite v0.1.0 // indirect
github.com/hanzoai/sqlcipher v0.1.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.3 // indirect
github.com/luxfi/accel v1.2.4 // indirect
github.com/luxfi/crypto v1.20.2 // indirect
github.com/luxfi/mdns v0.1.1 // indirect
github.com/luxfi/pq v1.1.0 // indirect
github.com/luxfi/zap v1.2.6 // indirect
github.com/mattn/go-colorable v0.1.15 // indirect
github.com/mattn/go-isatty v0.0.22 // indirect
github.com/miekg/dns v1.1.72 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.opentelemetry.io/otel v1.44.0 // indirect
go.opentelemetry.io/otel/log v0.20.0 // indirect
go.opentelemetry.io/otel/metric v1.44.0 // indirect
go.opentelemetry.io/otel/sdk v1.44.0 // indirect
go.opentelemetry.io/otel/sdk/log v0.20.0 // indirect
go.opentelemetry.io/otel/trace v1.44.0 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/mod v0.38.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/text v0.41.0 // indirect
golang.org/x/tools v0.48.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
modernc.org/libc v1.72.3 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.51.0 // indirect
)