slouchpie

slouchpie

Vague idea - IndexedDB + Ecto

PWAs use a thing called IndexedDB

I was reading the docs this morning and thought how cool it would be if there was some package built on top of Ecto that could automatically convert a project’s existing Ecto schemas to “object stores” (that’s what they’re called).

Even in a new project, maintaining the object store schemas to accord with the Ecto schemas is a burden (Absinthe devs will know this pain). It would be cool if it could be automated.

You can see an example of how an object store is built here:

I throw this vague idea into the void and see if anything resonates…

Most Liked

garrison

garrison

Might be better to look towards OPFS instead. I don’t have a source off the top of my head but I have heard many times that IndexedDB is, for various reasons, very unpleasant to deal with. My understanding is that going forward OPFS will be better (and is now widely available).

bartblast

bartblast

Creator of Hologram

I have something along these lines planned for the local-first stage of Hologram. I agree with @garrison that OPFS is probably the way to go here.

One thing to keep in mind though – it needs to be a little more involved than just storing data on the client. You’d probably want:

  • Auto-sync between client and server

  • Managing schema and data migrations on the client-side

  • Deciding what subsets of data to sync to the client-side (not everything should/can be synced)

slouchpie

slouchpie

@garrison Yes, OPFS looks much better. Thank you!

@bartblast Very exciting to hear about local-first plans. I might play with the OPFS stuff myself just to see what is possible.

Where Next?

Popular in Discussions Top

lichuan
Hi, I’ve created a new repository on GitHub to compare the fairness and real-time performance of schedulers in Erlang and Go. Feel free t...
New
lud
Hello, I just extracted the boilerplate management code that I used to work with in previous years: It is yet another generic input d...
New
New
smueller
With the announcement of 1.19 rc0 and the path to user-supplied type annotations, I want to make the case for inline types—both for funct...
New
yolo007wizard
I’ve been reading up on Firefly and it looks very impressive. Does this mean faster CPU bound Elixir? i.e. ballpark java speeds? Or at le...
New
dogweather
I’ve been brainstorming about ways to solve the N-dimensional code organization problem, and am thinking about developing a Smalltalk-lik...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New
kusokuzeshiki
I tried to generate pages with claude code and fluxon ui. I ask to claude code to generate real world page samples, the results are thes...
New
chrisliaw
Hi, I’m wondering is it my thinking process or this is the norm among the Elixir developer for the use of Struct and accessor functions ...
New
gushonorato
Hey everyone, I’ve been working with Elixir for over 5 years and I’m a big enthusiast of the language. However, when starting new projec...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New

We're in Beta

About us Mission Statement