Here at Electric, we are thrilled to have published version 0.7 of ElectricSQL, which includes the new migration proxy and extended type support. This release lays the groundwork for many of the new features we are currently working on, and which will be available in future versions. Version 0.6, released in September, was the largest release of Electric since we began, and the culmination of six months of hard work; you can read about the previous release here.
This new version builds on 0.6 by adding a number of key new features:
- Postgres Proxy
- Additional type support
- Improvements to the "starter"
- Support for Capacitor
You can learn more about these below.
A major new feature in Electric is the Postgres Proxy; this is a proxy provided by the Electric sync service, of use when applying migrations to your database. This first version of the proxy interprets our DDLX rules, running the required operations on your database; it enables the
ALTER TABLE issue ENABLE ELECTRIC; syntax, and it is the precursor to having the full DDLX and permissions in future versions.
The proxy is also the starting point for addressing deployment to hosted Postgres providers with no superuser permissions. We still have a few things to address here, however this is the groundwork required to enable the solution in a future version.
When you apply any migrations to your Postgres you must remember to set the database url to the correct port (default 65432) on the Electric sync service.
You can read more about the proxy in our documentation here.
- Time and date types (
SQLite does not have a boolean type, using
These are stored as
ints in SQLite and validated to be within the correct range.
These are now correctly stored as
REALin SQLite, with support for
+inf/-inf. The only caveat is that
NaNis stored in string form due to a limitation in a number of SQLite drivers that convert
null, breaking the distinction between the two.
You can read more about type support in our documentation here.
We have updated our
npx create-electric-app@latest starter to enable building apps using the latest version of Electric, and to support the new proxy. We have also added support for multiple migrations in the
db/migrations directory using @databases/pg-migrations, see its documentation on how to use.
Community member Gregorio Zanon created a Capacitor driver, wrapping capacitor-community/sqlite; this enables a developer to use Electric for building mobile apps on iOS and Android using native SQLite.
You can read more about our Capacitor support in this post here.