fireproof-storage / fireproof

Realtime database, runs anywhere. Install Fireproof in your front-end app or edge function, and sync data via any backend.
https://fireproof.storage
Other
219 stars 16 forks source link

initial sql commit #118

Open mabels opened 2 weeks ago

mabels commented 2 weeks ago

This is the implementation of a sql connect method for fireproof.

jchris commented 2 weeks ago

this is using SQL as an external connector. it might be worth exploring what happens if you write this in a completely different part of the code base. eg instead of another connector (for background sync) it could be a storage option (for local compute/store) which I think is a better fit. Your code here looks good it's just I'm not sure it's solving the problem people want to use the SQL adapter for.

I would take a look at this node/fs storage module, and how to make a copy of it that uses SQL. You'll also need to wrench a config into the core module like this and the corresponding build here

In the end the approach I'm describing here would show up as:

import { fireproof } from "@fireproof/core/sql"

Which I know is kinda garnly so probably looking at how that storage system plumbed will give you some other ideas about cleanup.

mabels commented 2 weeks ago

this is using SQL as an external connector. it might be worth exploring what happens if you write this in a completely different part of the code base. eg instead of another connector (for background sync) it could be a storage option (for local compute/store) which I think is a better fit. Your code here looks good it's just I'm not sure it's solving the problem people want to use the SQL adapter for.

I would take a look at this node/fs storage module, and how to make a copy of it that uses SQL. You'll also need to wrench a config into the core module like this and the corresponding build here

In the end the approach I'm describing here would show up as:

import { fireproof } from "@fireproof/core/sql"

Which I know is kinda garnly so probably looking at how that storage system plumbed will give you some other ideas about cleanup.

what you described is where i'm headed to but as said before this is not done yet!

jchris commented 2 weeks ago

This is super exciting -- will be interesting to see how it compares to node/fs on the benchmark: https://github.com/dstanesc/fireproof-playground