use-pg-type 0.1.0

PostgreSQL type primitives for RustUse
Documentation
# use-pg-type

PostgreSQL type primitives for RustUse.

This crate provides type-name labels, broad type categories, common built-in type labels, array-like labels, and an optional primitive OID wrapper. It does not bind built-in labels to live PostgreSQL catalog OIDs.

## Example

```rust
use use_pg_type::{PgBuiltInType, PgTypeCategory, PgTypeName, PgTypeOid};

let ty: PgBuiltInType = "timestamptz".parse()?;
let text = PgTypeName::built_in(PgBuiltInType::Text);
let text_array = PgTypeName::array_of(&text);
let oid = PgTypeOid::new(23)?;

assert_eq!(ty.to_string(), "timestamp with time zone");
assert_eq!(PgBuiltInType::Jsonb.category(), PgTypeCategory::Json);
assert_eq!(text_array.to_string(), "text[]");
assert_eq!(oid.get(), 23);
# Ok::<(), use_pg_type::PgTypeError>(())
```