diff --git a/docs/reference/limitations.md b/docs/reference/limitations.md index 21d574db84..aba6c25304 100644 --- a/docs/reference/limitations.md +++ b/docs/reference/limitations.md @@ -49,10 +49,12 @@ This is a very temporary workaround and will be removed soon! We don't currently support any constraints except primary keys. You must remove all unique and check constraints from your Postgres data model. -We have limited data type support. The basic two types are TEXT and INTEGER. You can track progress on wider Postgres type support on [electric-sql/electric/pull/331](https://github.com/electric-sql/electric/pull/331) and related PRs. +We have limited data type support. Currently, we only support strings (`text` and non-length-limited `varchar`) and numbers (`smallint`, `integer`, `bigint`, `double precision`). The authoritative list of supported data types is maintained in the [`supported_pg_types/0` function][1]. We also only support forward and additive migrations. Migrations that remove columns or make them more restrictive will fail when applied to electrified tables. +[1]: https://github.com/search?q=repo%3Aelectric-sql%2Felectric+symbol%3Asupported_pg_types&type=code + ### Failure modes Currently, you are likely to experience bugs or behaviour that leads to an inconsistent data state. This is **not** related to the core [consistency model](./consistency.md). It's a consequence of the maturity of the implementation. @@ -164,17 +166,6 @@ Any existing trigger in an Electrified table will not be propagated to the clien The same trigger written for Postgres or SQLite end up having very different definitions and is difficult to convert between them. -### Data types - -#### Input validation - -SQLite and Postgres have very different type support, with SQLite having more basic data type support. It is crucial to respect Postgres schema when upstreaming changes, to ensure the replication stream doesn’t break. - -**Roadmap** - -- We are shipping proper support for type validation soon -- Working on ways of recovering ElectricSQL replication stream in case of client or server errors - ### Shapes #### Transitively replicate tables referred in foreign keys diff --git a/docs/usage/data-modelling/migrations.md b/docs/usage/data-modelling/migrations.md index a2246eb067..22e06aabdd 100644 --- a/docs/usage/data-modelling/migrations.md +++ b/docs/usage/data-modelling/migrations.md @@ -200,7 +200,9 @@ We only currently support additive migrations. This means you can't remove or re ### Data types -ElectricSQL maps between Postgres data types on the server and SQLite data types in the local app. This is not a perfect match. In many cases, SQLite does not have native support for a Postgres data type. +ElectricSQL maps between Postgres data types on the server and SQLite data types in the local app. This is not a perfect match. In many cases, SQLite does not have native support for a Postgres data type. However, our client libraries bridge the gap for the majority of Postgres types, providing a native JavaScript/TypeScript experience for any data type supported in electrified tables. + +We're actively working on expanding the range of Postgres data types ElectricSQL supports out of the box. ### Primary keys