an5-adapters
Database adapter runtime for AN5 ORM in Rust.
An5Adapter owns the connection and the dialect; TableClient provides the ORM
CRUD surface on top of sqlx. Dialects are
detected from the connection string, so SQL Server, PostgreSQL and SQLite are
handled without configuration. This crate mirrors the TypeScript, Python, .NET
and Go adapter packages.
Install
[]
= "0.1"
The crate is driver-agnostic: it depends on sqlx with any, so the application
picks the driver it needs and enables the matching sqlx feature.
[]
= { = "0.8", = false, = ["any", "runtime-tokio", "postgres"] }
Usage
use ;
use json;
async
Generated Rust clients (an5-client) wrap this crate and expose one typed handle
per model — db.user().find_many(&UserFindManyArgs { .. }) — instead of the
dynamic db.table("User") access shown above.
Features
An5Adapter::connect/create_an5_adapter, with the connection string read fromDATABASE_URLwhen omitted- Dialect detection and identifier quoting for MSSQL, PostgreSQL and SQLite
TableClient:find_many,find_first,find_unique,count,create,create_many,update,update_many,delete_many,upsert,aggregate,group_byandvector_search- Transactions, raw SQL execution and view clients
basemodule with the where/order-by builders, adapter metadata and vector distance math
License
MIT