Skip to content

Commit

Permalink
chore(docs): Clarify data type support status and plans (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
alco committed Aug 22, 2023
1 parent f60ce16 commit 7a38cfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
15 changes: 3 additions & 12 deletions docs/reference/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/usage/data-modelling/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7a38cfe

Please sign in to comment.