Crate tank

Crate tank 

Source

Modules§

future
Asynchronous values.
indoc
githubcrates-iodocs-rs
sink
Asynchronous sinks.
stream

Macros§

cols
Build a slice of column expressions (optionally ordered) suitable for a SELECT projection. Each comma separated item becomes either a expression (parsed via expr!) or a ordered expression when followed by ASC or DESC.
expr
Parse a Rust expression into a typed SQL expression tree.
impl_executor_transaction
Implement the Executor trait for a transaction wrapper type by delegating each operation to an underlying connection object.
join
Build a typed join tree from a concise SQL-like syntax.
month_to_number
number_to_month
possibly_parenthesized
Conditionally wrap a generated fragment in parentheses.
send_value
Sends the value through the channel and logs in case of error.
truncate_long
Truncate long strings for logging and error messages purpose.

Structs§

BinaryOp
ColumnDef
Declarative specification of a table column.
ColumnRef
Reference to a table column.
Context
ContextUpdater
DeclareTableRef
Wrapper used when declaring table references in generated macros.
FixedDecimal
Decimal wrapper enforcing compile-time width/scale.
GenericSqlWriter
Fallback generic SQL writer (closest to PostgreSQL / DuckDB conventions).
Interval
Join
Binary join of two datasets with optional ON predicate.
Ordered
References
Foreign key reference to another Entity’s columns.
RowLabeled
A result row with its corresponding column labels.
RowsAffected
Metadata about modify operations (INSERT/UPDATE/DELETE).
TableRef
Reference to a table (schema-qualified + optional alias).
TypeDecoded
Intermediate decoded type information used by derive macros.
UnaryOp

Enums§

Action
Referential action for foreign key updates or deletes.
BinaryOpType
EitherIterator
Polymorphic iterator adapter returning items from either variant.
Fragment
IntervalUnit
JoinType
Supported SQL join variants.
Operand
Order
Passive
Wrapper marking whether a column should be considered set or skipped (passive) on INSERT.
PrimaryKeyType
Indicates if and how a column participates in the primary key.
Query
A query ready to be executed by an [Executor].
QueryResult
Heterogeneous items emitted by Executor::run combining rows and modify results.
UnaryOpType
Value
Strongly-typed, nullable SQL value representation used across Tank.

Traits§

AsQuery
AsValue
Value conversion and simple parsing utilities. It is the central conversion and parsing abstraction used throughout tank to move between native Rust types and the dynamically typed Value representation that backs query parameters and row decoding.
ColumnTrait
Helper trait for types that expose an underlying column definition and reference.
Connection
A live database handle capable of executing queries and spawning transactions.
DataSet
Queryable data source (table or join tree).
Driver
A backend implementation providing connection + SQL dialect services.
Entity
Represents a database-backed record with schema and persistence behavior.
ErrorContext
Provides the context method for Result.
Executor
Async query executor bound to a concrete Driver.
Expression
A renderable SQL expression node.
OpPrecedence
Provides numeric precedence for expressions allowing sql writers to insert parentheses.
Prepared
A parameterized, backend-prepared query handle.
SqlWriter
Dialect printer converting semantic constructs into concrete SQL strings.
Transaction
A mutable transactional context implementing Executor.

Functions§

as_c_string
Convenience wrapper converting into a CString, panicking on interior NUL.
consume_while
Consume a prefix of input while the predicate returns true, returning that slice.
extract_number
matches_path
Determine if the trailing segments of a syn::Path match the expected identifiers.
print_timer
quote_btree_map
Quote a BTreeMap<K, V> into tokens.
quote_cow
Quote a Cow<T> preserving borrowed vs owned status for generated code.
quote_option
Quote an Option<T> into tokens.
separated_by
Write an iterator of items separated by a delimiter into a string.

Type Aliases§

CheckPassive
Error
Crate-wide error alias using anyhow.
Result
Crate-wide result alias using anyhow for flexible error context.
Row
Owned row value slice matching RowNames length.
RowNames
Shared reference-counted column name list.

Derive Macros§

Entity