docs(cli): add details in comments

This commit is contained in:
Matthieu Bessat 2026-03-30 21:57:49 +02:00
commit 76cdeb209d

View file

@ -19,8 +19,17 @@ pub struct SqlGeneratorModelAttr {
#[derive(FromAttr, PartialEq, Debug, Default)]
#[attribute(ident = sql_generator_field)]
pub struct SqlGeneratorFieldAttr {
/// indicate a primary key
/// primary usually means unique + indexed
is_primary: Option<bool>,
/// indicate a column consists of unique values
is_unique: Option<bool>,
/// name of the method to retreive a list of current type items from the point of view of the
/// remote foreign table
/// generally it's the same name as the current table
/// it can change depending on the context
reverse_relation_name: Option<String>,
/// to indicate that this field will be used to obtains entities
@ -29,7 +38,7 @@ pub struct SqlGeneratorFieldAttr {
}
#[derive(FromArgs, PartialEq, Debug)]
/// Generate SQL CREATE TABLE migrations
/// Generate .sql files with CREATE TABLE migrations
#[argh(subcommand, name = "gen-migrations")]
struct GenerateMigration {
/// path of file where to write all in one generated SQL migration
@ -54,13 +63,15 @@ enum GeneratorArgsSubCommands {
}
#[derive(FromArgs)]
/// SQLX Generator args
/// The Sqlxgentools CLI.
/// Sqlxgentools is a set of library and code generators program,
/// to help you to use a Sqlite3 database in your Rust app with Sqlx.
struct GeneratorArgs {
/// path where to find Cargo.toml
/// path of your main cargo project directory (with the projcet root Cargo.toml file)
#[argh(option)]
project_root: Option<String>,
/// path of the directory containing models
/// path of the project sub-directory containing models definitions
#[argh(option, short = 'm')]
models_path: Option<String>,