Can I reuse the AshPostgres filter conversion to Ecto for my own manual reads?

I'm trying to use Ash in a project where I have to support existing MSSQL Repos for a while. I thought I can solve this with ManualRead and got quite far, but now I'm trying to translate the Ash.Query occurrences to Ecto.Query and am out of my depth. I also tried to find the place in AshPostgres, where they are converted but was quite lost. Can anyone point me in the right direction to solve this?
3 Replies
ZachDaniel
ZachDaniel•3y ago
Hey there! So until we generalize ash_postgres into ash_sql, this will always come with a bit of a challenge however, there may be a way for you to do it, albeit a bit potentially hacky Try something like this
AshPostgres.DataLayer.filter(your_ecto_query, ash_filter, Resource)
AshPostgres.DataLayer.filter(your_ecto_query, ash_filter, Resource)
Your mileage may vary 🙂
Kagemaru
KagemaruOP•3y ago
Damn that was fast, thanks @Zach Daniel. I'll try this immediately.
user20230119
user20230119•2y ago
What did you do to use SQL Server with Ash?

Did you find this page helpful?