How are the real time subscriptions with SQLite achieved? Is this a feature of SQLite itself or something that PocketBase itself implements on top of it?
It's implemented in the application, it's not a feature of SQLite, but its very simple and robust - when a record is created/updated/deleted I'm broadcasting the change to all subscribers that are allowed to receive it (the access control is based on the colleciton's list and view rules).
That makes a lot of sense. Thanks for the link. I've not worked with Go before so I couldn't find exactly where the implementation was.
This looks like a very interesting project and great for some of the small client projects which I currently use Firebase. I'll be sure to take a proper look in the future!
Reading through the code/docs it looks like you can subscribe to individual records (database rows) or collections (tables), is this correct? In your Records.getList method, you have filter functionality that would be nice to subscribe to (ie. subscribe to changes in "demo" collection where totalComments > 10). Subscribing to a specific result set seems like it could scale better than notifying subscribers of all table changes, which then get filtered in the subscribe() callback func in the SDK. Very cool work!
Yes, you can subscribe to individual records or collections.
User defined filters for the subscriptions are not supported, but it's a good idea and I may consider it in the future. Currently the subscriptions are filtered through the collection's list and view rules - they also act as "admin level filters", aka. filters that are always applied and regular users cannot modify (getList user defined filters are only appended to the search query together with the admin defined filters).
Really neat! I’ve been wanting to make something similar for _years_ to be a standardized data modeling testbed as I explore/experiment/prototype some new feature or problem space or even doing ad-hoc fixes. I think this is a much better starting place than spreadsheets/similar.
Good luck with the project! Seems like you’ve got some good interest :-)
I really like this. All my current projects use Go as a backend and I definitely need my own routes and business logic, so PocketBase looks way easier to integrate into my existing code than the JavaScript based solutions.
And it would also give me more time to focus on business logic instead of Auth - i will definitely try this in the future.
Comments (111) 36 threads
Earlier commentsThe realtime api implementation could be found at https://github.com/pocketbase/pocketbase/blob/master/apis/re...
This looks like a very interesting project and great for some of the small client projects which I currently use Firebase. I'll be sure to take a proper look in the future!
User defined filters for the subscriptions are not supported, but it's a good idea and I may consider it in the future.
Currently the subscriptions are filtered through the collection's list and view rules - they also act as "admin level filters", aka. filters that are always applied and regular users cannot modify (getList user defined filters are only appended to the search query together with the admin defined filters).
Good luck with the project! Seems like you’ve got some good interest :-)
And it would also give me more time to focus on business logic instead of Auth - i will definitely try this in the future.
PocketBase was specifically designed to be self-contained and running only on a single server.
(I'm founder of Thin)
All comments shown.
Couldn't load more comments. Check your connection and try again.