vilterp / treesql

prototype: a relational database which supports live GraphQL-like queries. Written in Go with BoltDB storage.
37 stars 1 forks source link

Api #12

Open ghost opened 6 years ago

ghost commented 6 years ago

Have another idea which is pretty simple to add perhaps.

I would like to be able to use this in embedded scenario with flutter. Sure you have heard about flutter. It's very easy to use gomobile and expose a bind to flutter.

So the only issue I face is the " driver ". Currently treesql uses http and websockets.
I just need standard methods. Flutter can handle asynchronous two way comms so if treesql wants to send an update to the flutter GUI layer it should be fine.

Why ? Well we kill two birds here.

  1. No reflux style stuff needed at the GUI layer.
  2. Offline access

This opens the door to doing reconciliation on changes to the same data in many places. I am having interesting success with different CRDT libs and are porting automerge to golang as I get time.

I can make a flutter demo to plug into golang two way calls pretty easily. There are others already doing this. It can have a little golang loop pumping data in and out to show the mechanism working.

Wondering if it's a ton of work for you to expose a method API so I can build a gomobile binding and then join everything together

It should be just a matter of exposing a slightly different API.

It also leads to using g grpc of course with the improbable grpc-web drivers and gopherjs. That's very easy to implement as a different network driver.

Again I really am excited by the fact that this is 💯% golang based. It opens the door to easily be able to build sophisticated stuff.

ghost commented 6 years ago

If your curious :

https://flutter.io/platform-channels/

From golang it's very easy to hook in.