"Merge" ash_postgres and ash_sqlite

Hey there :slight_smile:

What is the blocker to not “merge” ash_postgres and ash_sqlite and use a more general ash data_layer (e.g. ash_ecto_sql) with support for all ecto supported adapters?
And would it make sense to implement such library to benefit from ecto’s already implemented adapters?

Thanks for this great library!! :fire:

There will always need to be two separate data layers, because Ash data layers are not pure SQL drivers. They make choices based on what a given data source’s capabilities are, that kind of thing. For example, AshPostgres supports aggregates via inner lateral joins, but AshSqlite does not support that, and if we want to support aggregates with it we will need to figure out a different strategy later. Same is with atomics, because sqlite doesn’t have a way to raise an error (that I could find) in the same way that ash_postgres does.

however, I would really like to see an ash_sql package extracted out that allows them to share the bulk of their logic as much of it is the same.

2 Likes