Open
Conversation
This was referenced Feb 17, 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.
Starting with 0.4.11, the core extension can infer the
putanddeletestatements for raw tables automatically if the name of the table in the local schema is given. Additionally, the extension registers an SQL function to create triggers recording writes on raw tables inps_crud.This PR exposes the new functionality:
RawTableSchemaclass wraps the local table name (and optionally, information about local-only columns and advanced options). There are two public constructors onRawTable:PendingStatementfor put and delete operations.RawTableSchemainstead. Put and delete statements can still be overridden, but they would be inferred by default.powersync_create_raw_table_crud_triggerSQL function creating triggers would have to be called by the user in migration. It takes a JSON-serialized description of the raw table though, so the Kotlin SDK adds thejsonDescription()method returning that as a string. We don't want to expose the serializer publicly since that would increase the size of the Swift helper framework, serializing to a string keeps the rest internal.Restparameter source can be used to make the core extension create a JSON object of columns that would otherwise be missing from the table. Having this available can help with migrations.When creating triggers, PowerSync supports additional options like
insertOnlyandtrackPreviousValues. Because triggers can now be created for raw tables as well, the same options are available. So, this refactors those parameters into a newTableOptionsclass. Existing constructors onTablecontinue to work unchanged (by forwarding parameters).A minor breaking change is that
table.copy(insertOnly=true)would no longer be supported because the field has moved to a different class. I've documented that, but I think the breaking change is worth it as it makes internals cleaner and I doubt many users were callingcopy()on tables.