-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dump SeaORM Dependency from SeaSchema's Migrator #59
Conversation
I think it might be easier to just remove the migrator from sea-schema altogether, keeping only the |
That would be better. This way we can avoid introducing additional connection related traits on sea-schema side |
But then we still need a way to get the connection out of impl<'c, C> SchemaManager<'c, C>
where
C: MigrationConnection,
{
pub fn get_connection(&self) -> &'c C::Connection {
self.conn.get_connection()
}
}
If we only keep |
It should work the other way around, downstream (sea-orm) lend the connection to SeaSchema instead of SeaSchema owning it |
I think it's worthwhile to have clear-cut crate boundary between things |
SeaORM lend the inner SQLx connection to SeaSchema? |
Yes |
Hopefully we can untangle this in 0.8.0 |
e52651b
to
082ca82
Compare
That's the target! Please review this PR @tyt2y3 |
082ca82
to
a6b696c
Compare
src/migration/cli.rs
Outdated
use sea_orm::{Database, DbConn}; | ||
use std::{fmt::Display, process::exit}; | ||
use tracing_subscriber::{prelude::*, EnvFilter}; | ||
//! Migrator CLI utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should drop this file and clap dependency entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clap
subcommand was used on sea-orm-cli
and sea-orm-migration
, both of them shared the save subcommand that's why I put it in sea-schema
.
I have removed clap
dependency and rewrite it as macros, 644741a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if that looks good @tyt2y3
A library crate cannot have |
Otherwise it looks good on sea-schema side |
PR Info
Adds
Multiple traits, structs and enums are added to attach with SeaORM
ConnectionTrait
,QueryResultTrait
,Statement
,DatabaseBackend
,MigrationErr
Breaking Changes
SchemaManager
behindprelude
module are moved to SeaORM as well