pub enum TargetDriver {
Sqlite,
MySql,
Postgres,
}Expand description
The SQL dialect a converted migration’s id-column syntax should target -
derived from the source Laravel app’s own DB_CONNECTION (see
TargetDriver::from_db_connection), not guessed independently of it.
Deliberately a small, local enum rather than a dependency on
larust_orm::config::Driver/Backend: this crate does no runtime DB
work at all (it only ever emits .sql text), so pulling in larust-orm
(and transitively sqlx) just for a 3-variant enum would be a real,
unjustified dependency-weight increase for a text-in/text-out module.
Variants§
Implementations§
Source§impl TargetDriver
impl TargetDriver
Sourcepub fn from_db_connection(value: &str) -> Self
pub fn from_db_connection(value: &str) -> Self
Maps a Laravel DB_CONNECTION value the same way env.rs’s own
SUPPORTED_DB_CONNECTIONS does (mariadb is a pure MySQL alias -
same wire protocol, same DDL). A DB_CONNECTION this crate doesn’t
recognize at all (sqlsrv, anything else, or no .env present)
falls back to Sqlite - not because that’s a good guess at the
real target, but because it’s the same “this migration can’t
actually run against the app’s real database anyway” situation
env.rs’s own resolve_database_connection already reports a
dedicated note for; there is no meaningfully-more-correct fallback
to pick instead.
Sourcepub fn support_feature(self) -> &'static str
pub fn support_feature(self) -> &'static str
The matching larust-support sqlx-driver feature name (see
larust-orm/Cargo.toml’s own [features] comment) - xr convert
pushes this into the generated app’s own Cargo.toml so a
converted app keeps whichever driver the source Laravel app
actually used, rather than silently falling back to the scaffold’s
"sqlite" default.