-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
If you have in diesel.toml:
[print_schema]
file = "src/schema.rs"
schema = "foo"And you do:
diesel print-schema > src/schema.rsYou'd get in src/schema.rs:
pub mod foo {
// ... schema types here ...
}Then you proceed to do:
diesel_ext --model --import-types 'crate::schema::*' --add-table-name > src/models.rsExpected src/models.rs
use crate::schema::*;
use chrono::NaiveDateTime;
use bigdecimal::BigDecimal;
use uuid::Uuid;
use diesel::prelude::*;
pub mod foo {
use super::*;
// ... model structs here ...
}Actual src/models.rs
use crate::schema::*;
use chrono::NaiveDateTime;
use bigdecimal::BigDecimal;
use uuid::Uuid;
use diesel::prelude::*;
pub mod foo {
// no `use super::*;` here
// ... model structs here ...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels