Conversation
…ws 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(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)!: replace URL connection string with JSON in cloudsync_network_init
Breaking change: cloudsync_network_init now accepts a JSON object instead of a URL string. The JSON format supports multi-org CloudSync by adding projectID and organizationID fields, and inserts projectID into the endpoint path. An X-CloudSync-Org header is automatically sent with every request.
New JSON format:
{"address":"https://host:443","database":"db.sqlite","projectID":"abc","organizationID":"org","apikey":"KEY"}
New endpoint format:
{scheme}://{host}{port}/v2/cloudsync/{projectID}/{database}/{siteId}/{action}
BREAKING CHANGE: URL connection strings are no longer accepted.
Integration tests now require PROJECT_ID, ORGANIZATION_ID, and DATABASE environment variables.
* Added a new compilation macro CLOUDSYNC_CHECK_NOTNULL_PRIKEYS (disabled by default) * 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. --------- Co-authored-by: Marco Bambini <marco@creolabs.com>
…umn_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).
…cloudsync_network_init
) * feat: add block-level LWW for fine-grained text conflict resolution Implements block-level Last-Writer-Wins for text columns across SQLite and PostgreSQL. Text is split into blocks (lines by default) and each block is tracked independently, so concurrent edits to different parts of the same text are preserved after sync. - Add block.c/block.h with split, diff, position, and materialize logic - Add fractional-indexing submodule for stable block ordering - Add cloudsync_set_column() and cloudsync_text_materialize() functions - Add cross-platform SQL abstractions for blocks table (SQLite/PostgreSQL) - Add block handling to PG insert, update, col_value, and set_column - Move network code to src/network/ directory - Bump version to 0.9.200 - Add 36 SQLite block LWW unit tests and 7 PostgreSQL test files - Update README and API docs with block-level LWW documentation * fix(ci): checkout submodules in GitHub Actions workflow
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.
No description provided.