tursodatabase / pg_turso

Postgres output plugin for replicating data to Turso.
MIT License
72 stars 4 forks source link

Use `CREATE MATERIALIZED VIEW` SQL syntax #4

Closed penberg closed 1 year ago

penberg commented 1 year ago

The CREATE MATERIALIZED VIEW has a USING method and WITH (storage_parameter = [value]... options. If we require the materialized view to materialize on PostgreSQL side also and replicate the already computed views, that lets us hook into a nicer syntax.

penberg commented 1 year ago

You can now use materialized views on PostgreSQL side and replicate them. We're not extending the syntax, but instead the materialized view is managed on PostgreSQL side and there are additional extension SQL functions that wire up the replication.