Struct migrant_lib::Config
[−]
[src]
pub struct Config { pub path: PathBuf, // some fields omitted }
Project configuration/settings
Fields
path: PathBuf
Methods
impl Config
[src]
fn use_migrations(
&mut self,
migrations: Vec<Box<Migratable>>
) -> Result<&mut Self>
[src]
&mut self,
migrations: Vec<Box<Migratable>>
) -> Result<&mut Self>
fn is_explicit(&self) -> bool
[src]
Migrations are explicitly defined
fn reload(&self) -> Result<Config>
[src]
Do a full reload of the configuration file, keeping track of
manually specified migrations
fn load_file_only<T: AsRef<Path>>(path: T) -> Result<Config>
[src]
Load config file from the given path without querying the database to check for applied migrations
fn load<T: AsRef<Path>>(path: T) -> Result<Config>
[src]
Load config file from the given path and query the database to load up applied migrations
fn init_in(dir: &Path) -> ConfigInitializer
[src]
Start a config initializer in the given directory
fn setup(&self) -> Result<bool>
[src]
- Confirm the database can be accessed
- Setup the database migrations table if it doesn't exist yet
fn migration_dir(&self) -> Result<PathBuf>
[src]
Return the absolute path to the directory containing migration folders
fn database_type(&self) -> Result<String>
[src]
Return the database type
fn database_path(&self) -> Result<PathBuf>
[src]
Return the absolute path to the database file. This is intended for sqlite3 databases only
fn connect_string(&self) -> Result<String>
[src]
Generate a database connection string. Not intended for file-based databases (sqlite)