How to (temporarily) disable data layer entirely

I know this looks weird, but - given a starter project, I would love to properly configure AshPostgres, and then to "comment out" it and swap with an in-memory (non actually persistent) alternative, e.g. Ash.DataLayer.Ets (even better if any accidental entry gets deleted in 24hrs). Use case: I just want to start and deploy a simple static HTML page that requires no logic, nor authentication. In the near future, as I develop features, I want to put them back in. But in the meantime, I want to deploy my app without actually spending $38 per month for a postgres db I would not hit (yes, I'm using fly.io). If I'm tackling this problem wrong, or if you suggest a better workflow, I'm all ears!
Solution:
But also if you're just not going to be using the resources at all, you can just not start your repo
Jump to solution
7 Replies
ZachDaniel
ZachDaniel5w ago
You can do it at compile time With an extension
Solution
ZachDaniel
ZachDaniel5w ago
But also if you're just not going to be using the resources at all, you can just not start your repo
ZachDaniel
ZachDaniel5w ago
as long as you don't call it it won't matter
sevenseacat
sevenseacat5w ago
Fly also gives you an option to use their unmanaged Postgres still, I think
venir.dev
venir.devOP5w ago
Nice! So that becomes a Phoenix matter, and Ash is not involved in this, right? Let me rephrase that: you mean not to start its supervisor in application.ex, right?
ZachDaniel
ZachDaniel5w ago
yep
venir.dev
venir.devOP5w ago
Thank you for the quick response, even though it wasn't closely related to ash 🙏

Did you find this page helpful?