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:Jump to solution
But also if you're just not going to be using the resources at all, you can just not start your repo
7 Replies
You can do it at compile time
With an extension
Solution
But also if you're just not going to be using the resources at all, you can just not start your repo
as long as you don't call it it won't matter
Fly also gives you an option to use their unmanaged Postgres still, I think
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?yep
Thank you for the quick response, even though it wasn't closely related to ash 🙏