CAST
functionality is used to cast to the type described by the schema.
CAST
is used to cast values to TEXT
, INTEGER
or REAL
.
INTEGER
will likely result in a “0” value.
undefined
.
TRUNCATE
the table before dropping, or remove the table from Sync Rules.
DROP
and CREATE
. If a dropped table is created again, and data is inserted into the new table, the schema change is detected by PowerSync. PowerSync will delete the old data in this case, as if TRUNCATE
was called before dropping.
TRUNCATE
of the old table, and replicates the new table.
This may be a slow operation if the table is large, and all other replication will be blocked until the new table is replicated.
DEFAULT
, INDEX
, FULL
, NOTHING
).
REPLICA IDENTITY FULL
, and any column is added, removed, renamed, or the type changed.
REPLICA IDENTITY DEFAULT
, and the type of any column in the primary key is changed.
REPLICA IDENTITY INDEX
, and the type of any column in the replica index is changed.
NULL
default value will generally not cause issues. Existing records will have a missing value instead of NULL
value, but those are generally treated the same on the client.
Adding a column with a different default value, whether it’s a static or computed value, will not have this default automatically replicated for existing rows. To propagate this value, make an update to every existing row.
Removing a column will not have the values automatically removed for existing rows on PowerSync. To propagate the change, make an update to every existing row.
Changing a column type, and/or changing the value of a column using an ALTER TABLE
statement, will not be automatically replicated to PowerSync. In some cases, the change will have no effect on PowerSync (for example changing between VARCHAR
and TEXT
types). When the values are expected to change, make an update to every existing row to propagate the changes.
insert
, update
, replace
, or delete
operation must be performed in any collection within a synced database.
todos
→ todos_old
→ todos
) are not directly supported. To reprocess the database after such changes, a Sync Rules update must be deployed.