pub struct Extension {
pub name: String,
pub schema: Option<String>,
pub version: Option<String>,
pub cascade: bool,
}Expand description
A database extension.
Fields§
§name: StringExtension name.
schema: Option<String>Schema to install in (PostgreSQL).
version: Option<String>Version to install.
cascade: boolWhether to cascade dependencies.
Implementations§
Source§impl Extension
impl Extension
Sourcepub fn new(name: impl Into<String>) -> ExtensionBuilder
pub fn new(name: impl Into<String>) -> ExtensionBuilder
Create a new extension.
pub fn pgvector() -> Self
pub fn uuid_ossp() -> Self
pub fn pgcrypto() -> Self
pub fn pg_trgm() -> Self
pub fn hstore() -> Self
pub fn ltree() -> Self
Sourcepub fn to_postgres_create(&self) -> String
pub fn to_postgres_create(&self) -> String
Generate PostgreSQL CREATE EXTENSION SQL.
Sourcepub fn to_postgres_drop(&self) -> String
pub fn to_postgres_drop(&self) -> String
Generate DROP EXTENSION SQL.
Sourcepub fn to_sqlite_load(&self) -> String
pub fn to_sqlite_load(&self) -> String
Generate SQLite load extension command.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Extension
impl<'de> Deserialize<'de> for Extension
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more