Expand description
Implementation of the spin postgres v3 db interface. Conversions between Rust, WIT and Postgres types.
§Types
Rust type | WIT (db-value) | Postgres type(s) |
---|---|---|
bool | boolean(bool) | BOOL |
i16 | int16(s16) | SMALLINT, SMALLSERIAL, INT2 |
i32 | int32(s32) | INT, SERIAL, INT4 |
i64 | int64(s64) | BIGINT, BIGSERIAL, INT8 |
f32 | floating32(float32) | REAL, FLOAT4 |
f64 | floating64(float64) | DOUBLE PRECISION, FLOAT8 |
String | str(string) | VARCHAR, CHAR(N), TEXT |
Vec<u8> | binary(list<u8>) | BYTEA |
chrono::NaiveDate | date(tuple<s32, u8, u8>) | DATE |
chrono::NaiveTime | time(tuple<u8, u8, u8, u32>) | TIME |
chrono::NaiveDateTime | datetime(tuple<s32, u8, u8, u8, u8, u8, u32>) | TIMESTAMP |
chrono::Duration | timestamp(s64) | BIGINT |
Structs§
- A database column
- A connection to a postgres database.
- A set of database rows
Enums§
- Data types for a database column
- Database values
- A pg error
- Errors related to interacting with a database.
- Values used in parameterized queries
- Errors related to interacting with a database.
Traits§
- A type that can be decoded from the database.
Type Aliases§
- A database row