Tags: sqliteai/sqlite-sync-dev
Tags
perf(postgres): use SQL template casting for non-PK column types (#4) * perf(postgres): use SQL template casting for non-PK column types Refactor type conversion for non-PK columns to use SQL template casting ($n::typename) instead of per-value SPI_execute_with_args("SELECT $1::typename") calls. This matches the pattern already used for primary key columns. Changes: - sql_postgresql.c: Add format_type() lookup and $n::coltype casting to SQL_BUILD_UPSERT_PK_AND_COL for non-PK column values - cloudsync_postgresql.c: Simplify cloudsync_decode_bytea_to_pgvalue() to return base types only (INT8, FLOAT8, TEXT, BYTEA) without SPI casting - cloudsync_postgresql.c: Remove lookup_column_type_oid() function - Add test 19 (19_uuid_pk_with_unmapped_cols.sql) covering UUID PK with unmapped non-PK types (JSONB, UUID, INET, CIDR) and all CRUD operations: INSERT, UPDATE non-PK, UPDATE mapped cols, DELETE, RESURRECT, UPDATE PK Performance benefit: Eliminates one SPI_execute call per non-PK column value during payload application, reducing overhead for unmapped PostgreSQL types. * test(postgres): new tests
feat: add support for UUID primary keys in PG (#3) * Fix for PG UUID used as PK * build(postgres): update test target for the current test files * docs(docs/postgresql/CLIENT.md): clarify primary key requirements for PostgreSQL and SQLite, added support for UUID primary keys * test(claude): add custom command for claude code to run sqlite-to-pg tests for the specified table schema --------- Co-authored-by: Marco Bambini <[email protected]>
PreviousNext