4 ms·
I know I’m late to the party, but I’ve recently come around to the idea of using apps that sit in front of Postgres to provide an API for free. This seems like
by shadowsun7 7y ago
I know I’m late to the party, but I’ve recently come around to the idea of using apps that sit in front of Postgres to provide an API for free. This seems like an amazing project! I mean, I knew PostgREST existed, but I didn’t realise think it would be possible to make something similar that worked for the real-time use case. Brilliant stuff!
- kiwicopple 7y agoI really love PostgREST. This was my early approach to realtime, using PostgREST for CRUD operations: https://paul.copplest.one/blog/nimbus-tech-2019-04.html#tech-stack https://paul.copplest.one/blog/nimbus-tech-2019-04.html#tech... Not much is different now except I don't use NOTIFY anymore due to the 8000 byte payload limitation (and the reason why I made the elixir server)
- numtel 7y agoI got around the 8000 byte limit by sending multiple notifications in this NPM package: https://github.com/numtel/pg-live-select/blob/master/lib/trigger.tpl.sql#L42 https://github.com/numtel/pg-live-select/blob/master/lib/tri... Reading the replication log is probably faster though. MySQL has row-based replication too and there's clients in most languages if you want to support it on your saas. Do you have plans to support changes to specific SELECT queries or keep it at the row level?
- kiwicopple 7y agoThat's quite clever, I never actually thought of that. Guessing from your username, this is your package? It's very cool Yes, we will allow filtering on the listener, just shipping early. Next steps, we will only filter on the Primary keys - something like supabase.from('users:id.eq.1') - but eventually we will support advanced filtering like this: https://supabase.io/docs/library/get#filtering https://supabase.io/docs/library/get#filtering