docs.rs failed to build sqlx-firebirdsql-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
sqlx-firebirdsql
A Firebird database driver for SQLx, the async Rust SQL toolkit.
Built on top of firebirust (a pure-Rust Firebird client library), this crate integrates Firebird as a first-class SQLx database backend.
Features
- Async connections via Tokio
- Connection pooling (
FirebirdPool) - Transactions
- Migrations (
migratefeature) Anydriver support (anyfeature)- Type-safe query parameter binding with
?placeholders
Connection URL
firebird://user:password@host:port/path/to/database.fdb
The default connection parameters are:
| Parameter | Default |
|---|---|
| Host | localhost |
| Port | 3050 |
| Username | SYSDBA |
| Password | masterkey |
| Wire crypt | true |
| Auth plugin | Srp256 |
Usage
Add the dependency to your Cargo.toml:
[]
= "0.1"
= { = "0.9.0-alpha.1", = ["_rt-tokio"] }
= { = "1", = ["rt-multi-thread", "macros"] }
Connecting and querying
use ConnectOptions;
use Executor;
use Row;
use FirebirdConnectOptions;
async
Connecting with a URL
use FromStr;
use ConnectOptions;
use FirebirdConnectOptions;
let opts = from_str?;
let mut conn = opts.connect.await?;
Type Mapping
Core types
| Rust type | Firebird type(s) |
|---|---|
bool |
BOOLEAN |
i8, i16 |
SMALLINT |
i32 |
INTEGER |
i64 |
BIGINT |
u8 |
SMALLINT |
u16 |
INTEGER |
u32 |
BIGINT |
u64 |
BIGINT (Decode only; may overflow) |
f32 |
FLOAT |
f64 |
DOUBLE PRECISION |
&str, String |
VARCHAR, CHAR |
&[u8], Vec<u8> |
BLOB |
chrono feature
Requires the chrono Cargo feature flag.
| Rust type | Firebird type(s) |
|---|---|
chrono::NaiveDate |
DATE |
chrono::NaiveTime |
TIME |
chrono::NaiveDateTime |
TIMESTAMP |
chrono::DateTime<chrono::Utc> |
TIMESTAMP |
rust_decimal feature
Requires the rust_decimal Cargo feature flag.
| Rust type | Firebird type(s) |
|---|---|
rust_decimal::Decimal |
NUMERIC, DECIMAL, DECFLOAT |
Nullable
Option<T> is supported where T implements Type. An Option<T> represents a potentially NULL value from Firebird.
Feature Flags
| Feature | Description |
|---|---|
any |
Enable the SQLx Any database driver |
json |
Enable JSON serialization support |
migrate |
Enable database migrations |
offline |
Enable offline query checking |
chrono |
Enable chrono date/time type conversions |
rust_decimal |
Enable rust_decimal numeric type conversions |
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.