Suggestion: Connector to Postgres

So I think Grist is great. The problem is that companies (including my own), already have data stored in other databases, like postgres, and it’s a ton work to migrate. Plus grist is missing some features that are critical for data (i.e. unique constraints etc.). What I’m considering doing is to use Grist as the interface to interact with the postgres data, as Grist has an amazing frontend for data entry/manipulation. The question, of course, is how to keep all the data in synch, as the postgres data would be the “source of truth.” We can do this via webhooks, but this gets very complicated quickly. Is there any way you can create some sort of connector from postgres, so that Grist gets the data from postgres and feeds it into the correct documents etc. in Grist? Does this make any sense? Have you considered this? In that way, postgres still is the source of truth, while Grist is the frontend to the database really, and Grist also stores a real-time copy of the postgres database in the grist sqlite database.

4 Likes

Hi there,

It does make sense to me. I do love GRIST as an interface to multiple related tables. Despite you can find apps that help to interact with databases, such as nocodb.com, GRIST goes beyond that, offering a more polished interface, associated with the power of Python formulas.

To have GRIST working as nocode.com, as an interface to SQL databases “on-premises”, is a dream to me! I think that would be better than “sync” features.

4 Likes

Hi - I have started doing this except the other way round. https://github.com/johncant/gristfdw

My use case is I would like to build some data pipelines that fetch data then INSERT into postgres, and don’t want them to depend on Grist. However, I actually want to store the data in Grist.

There is also some missing functionality in Grist that SQL has, and I could use Postgres for this by doing INSERT INTO grist_table (<some_query> FROM grist_table)

I also have a use case where I want to sync Grist with Firefly-iii. Currently I use n8n and a custom widget. However, it could make more sense to do it using PostgresSQL and FDWs.

Hope you find it useful!

https://electric-sql.com/ is software that synchronizes one or more Sqlite databases with one or more Postgres servers. You can INSERT (or UPDATE/DELETE) to sqlite (even when offline) , which is synchronized ( when you are online) to Postgres, or in reverse direction. No matter how - manualy with interactive client, or programmaticaly. So you can work with both databases at the same time and data is synchronized all the time.

1 Like

Totally agree: Grist is fantastic table orientated interface with unique features. The functions act like our eyes’ retina with smart cells doing a pre-processing of vision before passing the information to brains. For some large operations the connectivity to an underlaying database could be the dream stack. Here, a vote for Postgres (Supabase) https://community.getgrist.com/t/grist-x-supabase-low-level-connection/3765

2 Likes

Can two-way sync be done with n8n?