Skip to content

Disable notnull prikey constraints#12

Merged
andinux merged 6 commits intodevfrom
disable-notnull-prikey-constraints
Mar 10, 2026
Merged

Disable notnull prikey constraints#12
andinux merged 6 commits intodevfrom
disable-notnull-prikey-constraints

Conversation

@andinux
Copy link

@andinux andinux commented Mar 10, 2026

No description provided.

marcobambini and others added 6 commits March 9, 2026 08:42
Verify that INSERT operations with NULL primary key values are rejected
with an appropriate error message, even when the column lacks an explicit
NOT NULL constraint.
The extension now enforces NULL primary key rejection at runtime, so
the explicit NOT NULL constraint on PK columns is no longer a schema
requirement. Replace the "must be NOT NULL" guidance with a note about
runtime enforcement.
@andinux andinux merged commit 938d6ed into dev Mar 10, 2026
17 checks passed
andinux added a commit that referenced this pull request Mar 13, 2026
* fix(network): cloudsync_network_check_changes must not return the nrows value in case of error

`SELECT cloudysnc_network_check_changes();` was returning "Runtime error: 0" in case of error response from the cloudsync microservice instead of the real error message

* feat(rls): add complete support for RLS with batch merge in cloudsync_payload_apply

* Feat/add support for status endpoint (#10)

* feat(network): add support for new status endpoint

* refactor(network): structured JSON responses for sync functions. 
Example: {"send":{"status":"synced","localVersion":5,"serverVersion":5},"receive":{"rows":3,"tables":["tasks"]}}

* Feat/network support for multi org cloudsync (#11)

* Disable notnull prikey constraints (#12)

* The cloudsync extension now enforces NULL primary key rejection at runtime (any write with a NULL PK returns an error), so the explicit NOT NULL constraint on primary key  columns is no longer a schema requirement

* test: add null primary key rejection tests for SQLite and PostgreSQL

* docs: remove NOT NULL requirement from primary key definitions

The extension now enforces NULL primary key rejection at runtime, so
the explicit NOT NULL constraint on PK columns is no longer a schema
requirement. Replace the "must be NOT NULL" guidance with a note about
runtime enforcement.

* docs: add first draft of PERFORMANCE.md and CHANGELOG.md

* fix(postgresql): resolve commit_alter crash and BYTEA handling in column_text

Guard savepoint commit/rollback against missing subtransactions to prevent
segfault in autocommit mode. Add BYTEA support to database_column_text so encoded PKs are readable during refill_metatable after ALTER TABLE.
Enable alter table sync test (31).

* test: new alter table test for postgres

* feat: update endpoints to use databaseMangedId for /v2/cloudsync api
* feat(network)!: replace URL connection string with a UUID (managedDatabaseId)

BREAKING CHANGE: cloudsync_network_init now accepts a UUID string instead of the previous URL string. URL connection strings are no longer accepted. The managed database identifier returned by the CloudSync service when a new database is registered for sync. For SQLiteCloud projects, this value can be obtained from the project's OffSync page on the dashboard.

* docs: update docs for the new managedDatabaseId arg for cloudsync_network_init

* docs(examples): update example for the new managedDatabaseId arg for cloudsync_network_init
@andinux andinux deleted the disable-notnull-prikey-constraints branch March 13, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants