Skip to content

vox-sql API Reference (generated)

Crate: vox-sql · Version: 0.6.0 · Target: Library (lib.rs)

Engine-agnostic SQL app-plane backends (libSQL, Postgres, MySQL) for Vox.

Engine-agnostic SQL surface for Vox app-plane data backends.

Connects via VOX_APP_DB_URL, normalizes rows/values, and exposes DDL, introspection, and migration helpers for brownfield database interop.

FeatureDefault / Enables
defaultruntime
mysqlsqlx?/mysql
postgressqlx?/postgres
runtimedep:vox-db, dep:turso, dep:sqlx, dep:async-trait, dep:tokio, dep:vox-secrets
DependencyKind
vox-astNormal
vox-dbNormal
vox-secretsNormal
ModuleDescription
build—
ddl—
introspect—
migrate—
schema_model—
type_map—
StructDescription
SqlDialect—
SqlBackendError—
LibsqlBackend—
PostgresBackend—
MySqlBackend—
EnumDescription
PlaceholderStyle—
IdentifierQuoteStyle—
UpsertStyle—
ReturnClauseStyle—
SqlValue—
BackendKind—
AnySqlBackend—
TraitDescription
SqlBackend—
FunctionDescription
voxdb—
sqlite—
postgres—
mysql—
new—
from_url—
backend_kind—
connect_from_url—
connect_from_app_env—
dialect—
query—
execute—
begin_transaction—
commit_transaction—
rollback_transaction—
codex—
connect_from_config—
pool—
pool—
TypeDescription
SqlRow—
Dependency Topology, diagram 18 nodes, 7 edges: vox-sql → vox-ast; vox-sql → vox-db; vox-sql → vox-secrets; vox-cli → vox-sql; vox-cli-research → vox-sql; vox-codegen → vox-sql; vox-codegen-ts → vox-sqlvox-sqlvox-astvox-dbvox-secretsvox-clivox-cli-researchvox-codegenvox-codegen-ts
Diagram source
graph {
direction: right
node vox_sql: "vox-sql"
node vox_ast: "vox-ast"
vox_sql -> vox_ast
node vox_db: "vox-db"
vox_sql -> vox_db
node vox_secrets: "vox-secrets"
vox_sql -> vox_secrets
node vox_cli: "vox-cli"
vox_cli -> vox_sql
node vox_cli_research: "vox-cli-research"
vox_cli_research -> vox_sql
node vox_codegen: "vox-codegen"
vox_codegen -> vox_sql
node vox_codegen_ts: "vox-codegen-ts"
vox_codegen_ts -> vox_sql
}
Consumer CrateRole
vox-cliDirect workspace dependent
vox-cli-researchDirect workspace dependent
vox-codegenDirect workspace dependent
vox-codegen-tsDirect workspace dependent
KindSymbolSignatureSourceDescription
enumPlaceholderStylepub enum PlaceholderStylecrates/vox-sql/src/lib.rs#L36-L40—
enumIdentifierQuoteStylepub enum IdentifierQuoteStylecrates/vox-sql/src/lib.rs#L43-L46—
enumUpsertStylepub enum UpsertStylecrates/vox-sql/src/lib.rs#L49-L52—
enumReturnClauseStylepub enum ReturnClauseStylecrates/vox-sql/src/lib.rs#L55-L58—
structSqlDialectpub struct SqlDialectcrates/vox-sql/src/lib.rs#L61-L67—
fnvoxdbpub const fn voxdb() -> Selfcrates/vox-sql/src/lib.rs#L70-L78—
fnsqlitepub const fn sqlite() -> Selfcrates/vox-sql/src/lib.rs#L80-L88—
fnpostgrespub const fn postgres() -> Selfcrates/vox-sql/src/lib.rs#L90-L98—
fnmysqlpub const fn mysql() -> Selfcrates/vox-sql/src/lib.rs#L100-L108—
enumSqlValuepub enum SqlValuecrates/vox-sql/src/lib.rs#L112-L119—
typeSqlRowpub type SqlRow = Vec<(String, SqlValue)>crates/vox-sql/src/lib.rs#L121—
structSqlBackendErrorpub struct SqlBackendErrorcrates/vox-sql/src/lib.rs#L124-L126—
fnnewpub fn new(message: impl Into<String>) -> Selfcrates/vox-sql/src/lib.rs#L129-L133—
enumBackendKindpub enum BackendKindcrates/vox-sql/src/lib.rs#L145-L151—
fnfrom_urlpub fn from_url(url: &str) -> Result<Self, SqlBackendError>crates/vox-sql/src/lib.rs#L154-L177—
traitSqlBackendpub trait SqlBackend: Send + Synccrates/vox-sql/src/lib.rs#L182-L196—
enumAnySqlBackendpub enum AnySqlBackendcrates/vox-sql/src/lib.rs#L199-L205—
fnbackend_kindpub fn backend_kind(&self) -> BackendKindcrates/vox-sql/src/lib.rs#L210-L218—
fnconnect_from_urlpub async fn connect_from_url(url: &str) -> Result<Self, SqlBackendError>crates/vox-sql/src/lib.rs#L221-L229—
fnconnect_from_app_envpub async fn connect_from_app_env() -> Result<Self, SqlBackendError>crates/vox-sql/src/lib.rs#L232-L248—
fndialectpub fn dialect(&self) -> &SqlDialectcrates/vox-sql/src/lib.rs#L250-L258—
fnquerypub async fn query(crates/vox-sql/src/lib.rs#L261—
fnexecutepub async fn execute(&self, sql: &str, params: &[SqlValue]) -> Result<u64, SqlBackendError>crates/vox-sql/src/lib.rs#L276-L284—
fnbegin_transactionpub async fn begin_transaction(&self) -> Result<(), SqlBackendError>crates/vox-sql/src/lib.rs#L287-L295—
fncommit_transactionpub async fn commit_transaction(&self) -> Result<(), SqlBackendError>crates/vox-sql/src/lib.rs#L298-L306—
fnrollback_transactionpub async fn rollback_transaction(&self) -> Result<(), SqlBackendError>crates/vox-sql/src/lib.rs#L308-L316—
structLibsqlBackendpub struct LibsqlBackendcrates/vox-sql/src/lib.rs#L320-L323—
fncodexpub fn codex(&self) -> &Codexcrates/vox-sql/src/lib.rs#L328-L330—
fnconnect_from_configpub async fn connect_from_config(config: DbConfig) -> Result<Self, SqlBackendError>crates/vox-sql/src/lib.rs#L332-L340—
structPostgresBackendpub struct PostgresBackendcrates/vox-sql/src/lib.rs#L433-L437—
fnpoolpub fn pool(&self) -> &PgPoolcrates/vox-sql/src/lib.rs#L442-L444—
structMySqlBackendpub struct MySqlBackendcrates/vox-sql/src/lib.rs#L562-L566—
fnpoolpub fn pool(&self) -> &MySqlPoolcrates/vox-sql/src/lib.rs#L571-L573—
enumbuild::SqlPredicatepub enum SqlPredicatecrates/vox-sql/src/build.rs#L4-L17—
fnbuild::placeholder_sqlpub fn placeholder_sql(dialect: &SqlDialect, index: usize) -> Stringcrates/vox-sql/src/build.rs#L19-L25—
fnbuild::equality_predicate_sqlpub fn equality_predicate_sql(dialect: &SqlDialect, field: &str, index: usize) -> Stringcrates/vox-sql/src/build.rs#L27-L29—
fnbuild::scalar_predicate_sqlpub fn scalar_predicate_sql(crates/vox-sql/src/build.rs#L31—
fnbuild::contains_predicate_sqlpub fn contains_predicate_sql(dialect: &SqlDialect, field: &str, index: usize) -> Stringcrates/vox-sql/src/build.rs#L40-L47—
fnbuild::predicate_sqlpub fn predicate_sql(dialect: &SqlDialect, pred: &SqlPredicate, next_param: &mut usize) -> Stringcrates/vox-sql/src/build.rs#L49-L79—
fnddl::to_snake_casepub fn to_snake_case(name: &str) -> Stringcrates/vox-sql/src/ddl.rs#L7-L28—
fnddl::live_table_namepub fn live_table_name(table: &TableDecl) -> Stringcrates/vox-sql/src/ddl.rs#L31-L39—
fnddl::type_expr_to_vox_typepub fn type_expr_to_vox_type(ty: &TypeExpr) -> Stringcrates/vox-sql/src/ddl.rs#L42-L77—
fnddl::index_to_ddlpub fn index_to_ddl(_backend: BackendKind, idx: &IndexDecl) -> Stringcrates/vox-sql/src/ddl.rs#L80-L87—
fnddl::table_to_ddlpub fn table_to_ddl(crates/vox-sql/src/ddl.rs#L89—
fnddl::add_column_ddlpub fn add_column_ddl(crates/vox-sql/src/ddl.rs#L118—