DatabaseConfig

Struct DatabaseConfig 

Source
pub struct DatabaseConfig {
Show 14 fields pub dialect: Dialect, pub schema: Schema, pub out: PathBuf, pub breakpoints: bool, pub driver: Option<Driver>, pub tables_filter: Option<Filter>, pub schema_filter: Option<Filter>, pub extensions_filters: Option<Vec<Extension>>, pub entities: Option<EntitiesFilter>, pub casing: Option<Casing>, pub introspect: Option<IntrospectConfig>, pub verbose: bool, pub strict: bool, pub migrations: Option<MigrationsOpts>, /* private fields */
}
Expand description

Configuration for a single database

This structure matches drizzle-kit’s config format for compatibility.

Fields§

§dialect: Dialect

Database dialect (required)

§schema: Schema

Path(s) to schema file(s) - supports glob patterns

§out: PathBuf

Output directory for migrations (default: “./drizzle”)

§breakpoints: bool

Whether to use SQL breakpoints in migrations (default: true)

§driver: Option<Driver>

Database driver for Rust connections

§tables_filter: Option<Filter>

Table name filter (glob patterns supported)

§schema_filter: Option<Filter>

Schema name filter (PostgreSQL only)

§extensions_filters: Option<Vec<Extension>>

Extensions filter (PostgreSQL only, e.g., [“postgis”])

§entities: Option<EntitiesFilter>

Entities filter (roles, etc.)

§casing: Option<Casing>

Casing mode for generated code

§introspect: Option<IntrospectConfig>

Introspection configuration

§verbose: bool

Verbose output

§strict: bool

Strict mode - deprecated, use explain flag instead

§migrations: Option<MigrationsOpts>

Migration table configuration

Implementations§

Source§

impl DatabaseConfig

Source

pub fn credentials(&self) -> Result<Option<Credentials>, Error>

Get typed credentials, resolving any environment variable references

Source

pub fn migrations_dir(&self) -> &Path

Migrations output directory

Source

pub fn meta_dir(&self) -> PathBuf

Meta directory (for journal)

Source

pub fn journal_path(&self) -> PathBuf

Journal file path

Source

pub fn schema_display(&self) -> String

Schema paths display string

Source

pub fn schema_files(&self) -> Result<Vec<PathBuf>, Error>

Resolve schema files (with glob support)

Source

pub fn effective_casing(&self) -> Casing

Get effective casing mode (default: camelCase)

Source

pub fn effective_introspect_casing(&self) -> IntrospectCasing

Get effective introspect casing mode (default: camel)

Source

pub fn effective_entities(&self) -> EntitiesFilter

Get entities filter (default: empty)

Source

pub fn should_include_role(&self, role_name: &str) -> bool

Check if a role should be included based on entities filter

Source

pub fn roles_enabled(&self) -> bool

Check if roles are enabled in entities filter

Source

pub fn extensions(&self) -> &[Extension]

Get extensions filters (PostgreSQL only)

Source

pub fn has_extension(&self, ext: Extension) -> bool

Check if an extension is in the filter list

Source

pub fn migrations_table(&self) -> &str

Get migration table name (default: __drizzle_migrations)

Source

pub fn migrations_schema(&self) -> &str

Get migration schema (PostgreSQL only, default: drizzle)

Trait Implementations§

Source§

impl Clone for DatabaseConfig

Source§

fn clone(&self) -> DatabaseConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DatabaseConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DatabaseConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,