Crate hdbconnect [] [src]

Experimental native rust database driver for SAP HANA(TM).

This crate compiles with rust stable, but for using the interesting part of its API you need serde's serialization and deserialization. You either add

#![feature(proc_macro)]

#[macro_use]
extern crate serde_derive;

to your crate root and

chrono = { version = "0.2", features = ["serde"] }
serde_derive ="*"

to your dependencies-list in Cargo.toml, and use rust nightly for compiling. Or you go with the somewhat cumbersome workaround described by serde to stick with rust stable.

The reason for publishing this driver in its immature state is to demonstrate how serde can be used to simplify the API of such a database driver.

Concretely, we use serde to simplify the data exchange between your code and the driver, both for input parameters to prepared statements and for results that you get from the database: there is no need to iterate over a complex resultset by rows and columns!

This approach allows, in contrast to many ORM mapping variants, using the full flexibility of SQL (projection lists, all kinds of joins, unions, etc, etc). Whatever query you need, you just use it, and whatever result structure you need, you just use a corresponding rust structure into which you deserialize the data.

See code examples for an overview.

Modules

code_examples

Here are some code examples for the usage of this database driver.

metadata

Types for describing metadata.

types

Types that are used within the content part of a ResultSet.

Structs

Connection

Connection object.

PreparedStatement

Allows injection-safe SQL execution and repeated calls with different parameters with as few roundtrips as possible.

ResultSet

Contains the result of a database read command, including the describing metadata.

Enums

HdbError

Represents all possible errors that can occur in hdbconnect.

HdbResponse

Represents all possible non-error responses to a database command.

HdbReturnValue

An enum that describes a single database return value.

Type Definitions

HdbResult

An abbreviation of Result<T, HdbError>.