ElectricSQL syncs data between Postgres and SQLite.
To do this, we map between Postgres data types and SQLite data types. In addition, we validate local writes to ensure that the values written into the local database will successfully replicate into Postgres.
As a result, we support a limited set of validated Postgres data types. If you try to electrify a table which contains unsupported types or constraints, this will fail. The same applies to altering an electrified table.
Primary keys must be unique and immutable.
ElectricSQL does not support sequential autoincrementing integer IDs. You must use globally unique primary key identifiers. Typically this means binary UUIDs.
You are responsible for ensuring the uniqueness of your primary keys. If you somehow concurrently create two rows with the same primary key this will cause an integrity violation when the rows are synced.
Supported data types
varchar(without length specifier)
Date and time:
time(without precision specifier)
timestamptz(without precision specifier)
The authoritative list of supported data types is maintained in the
We are actively working on building out data type support. If you need a type we don't yet support, please let us know on Discord.