datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Filipe Silva 2020-01-09T16:52:05.002Z

Heya, just wanted to let you know that datafire is now available as 0.1.1 at https://github.com/filipesilva/datafire. It lets you persist Datascript databases in Firebase's Firestore. Supports offline usage and multi-user synchronization. You can use Firestore Security Rules to limit access. If you're persisting Datascript and this fits your usecase let me know, and also let me know if you've been looking for something like this but with more features. Very interested in how this setup can be pushed further.

👍 3
2020-01-14T12:39:06.003900Z

Interesting, I did something similar but with sqlite. However I used the listen! Directly inside the library instead of on user code. That way the user could still keep using Datascript/transact! Instead of the library one

2020-01-14T12:39:30.004500Z

PS: it would probably be good to publish this on #announcements to reach more people 😉

2020-01-14T12:42:46.004700Z

Question: is there a way to restore the local Datascript from firestore? Or is the local one always assumed to be the master? I'm thinking of a it who opens the same app on another computer/phone

Filipe Silva 2020-01-15T13:33:11.007700Z

heya!

Filipe Silva 2020-01-15T13:33:22.007900Z

I did put it on accouncements, or news and articles

Filipe Silva 2020-01-15T13:33:23.008100Z

one of them

Filipe Silva 2020-01-15T13:33:50.008300Z

well both of them, but since cross posting between them is not allowed, the other one got taken down

Filipe Silva 2020-01-15T13:34:36.008500Z

I kept the transact on this lib because the loop needed to be firestore as the canonical source

Filipe Silva 2020-01-15T13:34:52.008700Z

stuff might happen before it hits firestore, for instance

Filipe Silva 2020-01-15T13:35:05.008900Z

the local datascript database is always restored from the remote

Filipe Silva 2020-01-15T13:35:49.009100Z

if two people open it in different devices, they will both see the dame database

Filipe Silva 2020-01-15T13:37:17.009300Z

they will also see each others writes

Filipe Silva 2020-01-15T13:39:56.009500Z

all of that works offline too, if you enable firestore's persistence

2020-01-16T17:48:51.009900Z

oh nice 🙂 thanks for the info

Filipe Silva 2020-01-16T19:22:39.010100Z

let me know if you use it, and if it does what you need, and also if it doesn't 😄

2020-01-16T19:26:59.010300Z

for the time being I probably wont use it since I dont have the need right now. However some months ago I was searching for something like that but couldnt find anything; which is why at the end I went with a local sqlite storage 😅 Maybe it helps you get some inspiration: https://github.com/hiposfer/hive/blob/master/src/hive/services/sqlite.cljs