我现在使用这个命令在 Rust Diesel 中生成模式:
diesel --database-url postgres://postgres:kZLxttcZSN@127.0.0.1:5432/rhythm \
migration run --config-file="${CURRENT_DIR}"/diesel-rhythm.toml
这是 toml 配置文件:
[print_schema]
file = "src/model/diesel/rhythm/rhythm_schema.rs"
# This will cause only the users and posts tables to be output
filter = { only_tables = ["favorites", "songs", "playlist"] }
是否可以让柴油自动生成模型实体?该实体可能长这样:
#[derive( Serialize, Queryable, Deserialize,Default)]
pub struct Music {
pub id: i64,
pub name: String,
pub source_id: String
}
现在我使用handle方式编写实体。我该如何让它通过Diesel CLI生成?我已经阅读了文档,但没有找到任何有用的配置。
Music
模型吗? - Njuguna Mureithi