Skip to main content

Crate use_pg_extension

Crate use_pg_extension 

Source
Expand description

§use-pg-extension

PostgreSQL extension metadata primitives for RustUse.

This crate provides extension names, version labels, schema metadata, relocatable labels, and safe generic constants for common extension names. It does not depend on or implement any extension functionality.

§Example

use use_pg_extension::{PgExtension, PgExtensionName, PgExtensionVersion, PGCRYPTO_EXTENSION};
use use_pg_schema::PgSchemaName;

let extension = PgExtension::new(PgExtensionName::pgcrypto())
    .with_version(PgExtensionVersion::new("1.3")?)
    .with_schema(PgSchemaName::public());

assert_eq!(PGCRYPTO_EXTENSION, "pgcrypto");
assert_eq!(extension.name().as_str(), "pgcrypto");
assert_eq!(extension.version().map(PgExtensionVersion::as_str), Some("1.3"));

Structs§

PgExtension
PostgreSQL extension metadata.
PgExtensionName
PostgreSQL extension name primitive.
PgExtensionVersion
PostgreSQL extension version label.

Enums§

PgExtensionError
Error returned when PostgreSQL extension metadata is invalid.

Constants§

CITEXT_EXTENSION
Safe generic extension name constant for citext.
HSTORE_EXTENSION
Safe generic extension name constant for hstore.
PGCRYPTO_EXTENSION
Safe generic extension name constant for pgcrypto.
PG_TRGM_EXTENSION
Safe generic extension name constant for pg_trgm.
POSTGIS_EXTENSION
Safe generic extension name constant for postgis.
UUID_OSSP_EXTENSION
Safe generic extension name constant for uuid-ossp.
VECTOR_EXTENSION
Safe generic extension name constant for vector.