glyph/DBXS

SQLAlchemy Core support

Opened this issue · 0 comments

While initially designed for plain SQL, DBXS's organizational idiom can be equally useful with an expression AST such as SQLAlchemy Core. Although SQL injection is not a concern with SQLAlchemy Core as it will properly quote anything in its AST (as long as you don't use sqlalchemy.text), idiomatic use of inline SQLAlchemy expressions leads to lots of duplicative re-building of the same structures, both in Python and within the database driver, where small variances might bust the prepared-statement cache in some database drivers.

A DBXS interface to SQLAlchemy Core could ensure that idiomatic queries use proper bind parameters rather than ad-hoc literal inlining. In turn, SQLAlchemy Core can provide many of its features — for example, validated database-portable SQL rendering, for applications that do really have a requirement for multiple DB backends — to DBXS applications.