[−][src]Crate hdbconnect
Native rust database driver for SAP HANA (TM).
hdbconnect
provides a lean, fast, and easy-to-use rust-API for working with
SAP HANA. The driver is written completely in rust. It comes
with an API that interoperates elegantly with all data types that implement the standard
serde::Serialize
and/or serde::Deserialize
traits, for input and output respectively.
Instead of iterating over a resultset by rows and columns, you can assign the complete query result directly to any rust structure that fits the data semantics.
hdbconnect
implements this with the help of serde_db
,
a reusable library for simplifying the data exchange between application code
and database drivers, both for input parameters (e.g. to prepared statements)
and for results that are returned from the database.
In contrast to typical ORM mapping variants, this approach allows using the full flexibility of SQL (projection lists, all kinds of joins, unions, nested queries, etc). Whatever query you need, you just use it, without further ado for defining object models etc., and whatever result structure you want to read, you just use a corresponding rust structure into which you deserialize the data. It's hard to use less code!
See code examples for an overview.
Re-exports
pub use r2d2; |
pub use serde_db; |
Modules
code_examples | Code examples. |
types | Non-standard types that are used within the
|
Structs
ConnectParams | An immutable struct with all information necessary to open a new connection to a HANA database. |
ConnectParamsBuilder | A builder for |
Connection | A synchronous connection to the database. |
ConnectionManager | Implementation of r2d2's
|
HdbResponse | Represents all possible non-error responses to a database command. |
OutputParameters | Describes output parameters, as they can be returned by procedure calls. |
ParameterDescriptor | Metadata for a parameter. |
ParameterDescriptors | Describes a set of IN, INOUT, and OUT parameters. Can be empty. |
PreparedStatement | Allows injection-safe SQL execution and repeated calls of the same statement with different parameters with as few roundtrips as possible. |
ResultSet | The result of a database query. |
ResultSetMetadata | Metadata for the fields in a result set. |
Row | A single line of a |
ServerError | Describes an error that is reported from the database. |
ServerUsage | Describes the server-side resource consumption. |
Enums
ExecutionResult | Describes the success of a command. |
HdbError | A list specifying categories of |
HdbReturnValue | An enum that describes a single database return value. |
HdbValue | Enum for all supported database value types. |
ParameterBinding | Describes whether a parameter is Nullable or not or if it has a default value. |
ParameterDirection | Describes whether a parameter is used for input, output, or both. |
ServerCerts | Expresses where Certificates for TLS are read from. |
Severity | Severity of a server message |
TypeId | ID of the value type of a database column or a parameter. |
Constants
DEFAULT_FETCH_SIZE | Default value for the number of resultset lines that are fetched with a single FETCH roundtrip; the constant's value is 100,000. |
DEFAULT_LOB_READ_LENGTH | Number of bytes (for BLOBS and CLOBS) or 1-2-3-byte sequences (for NCLOBS) that are fetched in a single LOB READ roundtrip; the constant's value is 16,000,000. |
DEFAULT_LOB_WRITE_LENGTH | Number of bytes that are written in a single LOB WRITE roundtrip; the constant's value is 16,000,000. |
Traits
IntoConnectParams | A trait implemented by types that can be converted into a |
IntoConnectParamsBuilder | A trait implemented by types that can be converted into a |
Type Definitions
HdbResult | Abbreviation of |