[−][src]Module butane_core::db
Types, traits, and methods for interacting with a database.
The different ways of referring to a database handle may present some initial confusion.
ConnectionMethods
is a trait containing the methods available on a database connection or a transaction. Most methods on a DataObject or a Query require an implementation ofConnectionMethods
.BackendConnection
is a trait representing a direct connection to a database backend. It is a superset ofConnectionMethods
and also includes the ability to create a transaction.Transaction
is a struct representing a database transaction. It implementsConnectionMethods
.Connection
is a convience struct containing a boxedBackendConnection
. It cannot do anything other than what aBackendConnection
can do, but allows using a single concrete type that is not tied to a particular database backend. It is returned by theconnect
method.
Structs
Column | Represents a database column. Most users do not need to use this directly. |
Connection | Database connection. May be a connection to any type of database as it is a boxed abstraction over a specific connection. |
ConnectionSpec | Connection specification. Contains the name of a database backend
and the backend-specific connection string. See connect
to make a Connection from a |
Row | Represents a database row. Most users do not need to use this directly. |
Transaction | Database transaction. |
Traits
Backend | Database backend. A boxed implementation can be returned by name via get_backend. |
BackendConnection | Database connection. |
ConnectionMethods | Methods available on a database connection. Most users do not need
to call these methods directly and will instead use methods on
DataObject or the |
Functions
connect | Connect to a database. For non-boxed connections, see individual Backend implementations. |
get_backend | Find a backend by name. |
Type Definitions
QueryResult | |
RawQueryResult |