Skip to content

Commit

Permalink
style(lib): add extra examples to connection_type in GenerationConf…
Browse files Browse the repository at this point in the history
…ig and binary help
  • Loading branch information
hasezoey committed Nov 19, 2023
1 parent 58462ca commit 830655e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,15 @@ pub struct MainOptions {
#[arg(short = 'g', long = "autogenerated-columns")]
pub autogenerated_columns: Option<Vec<String>>,

/// rust type which describes a connection, for example: "diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::pg::PgConnection>>"
#[arg(short = 'c', long = "connection-type")]
/// rust type which describes a connection
///
/// For example:
/// - `diesel::pg::PgConnection`
/// - `diesel::sqlite::SqliteConnection`
/// - `diesel::mysql::MysqlConnection`
/// - `diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::pg::PgConnection>>`
/// - or, your custom diesel connection type (struct which implements `diesel::connection::Connection`)
#[arg(short = 'c', long = "connection-type", verbatim_doc_comment)]
pub connection_type: String,

/// Disable generating serde implementations
Expand Down
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,12 @@ pub struct GenerationConfig<'a> {
pub default_table_options: TableOptions<'a>,
/// Connection type to insert
///
/// Example: `diesel::SqliteConnection`
/// For example:
/// - `diesel::pg::PgConnection`
/// - `diesel::sqlite::SqliteConnection`
/// - `diesel::mysql::MysqlConnection`
/// - `diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::pg::PgConnection>>`
/// - or, your custom diesel connection type (struct which implements `diesel::connection::Connection`)
pub connection_type: String,
/// Diesel schema import path
///
Expand Down

0 comments on commit 830655e

Please sign in to comment.