# "Merge" ash\_postgres and ash\_sqlite

**URL:** <https://forum.elixirforum.com/t/merge-ash-postgres-and-ash-sqlite/61385>\
**Category:** Questions\
**Tags:** ash, ash\_postgres\
**Created:** [February 1, 2024, 8:37am UTC](https://forum.elixirforum.com/t/merge-ash-postgres-and-ash-sqlite/61385 "2024-02-01T08:37:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![n0gg1n](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/n0gg1n/32/18271_2.png) [@n0gg1n](https://forum.elixirforum.com/u/n0gg1n)\
**Post date:** [February 1, 2024, 8:37am UTC](https://forum.elixirforum.com/t/merge-ash-postgres-and-ash-sqlite/61385/1 "2024-02-01T08:37:48Z")

</div>

Hey there 🙂

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!! 🔥

---

<div class="post-metadata">

**Author:** ![zachdaniel](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/zachdaniel/32/31980_2.png) [@zachdaniel](https://forum.elixirforum.com/u/zachdaniel)\
**Post date:** [February 1, 2024, 1:50pm UTC](https://forum.elixirforum.com/t/merge-ash-postgres-and-ash-sqlite/61385/2 "2024-02-01T13:50:01Z")

</div>

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.
