Skip to content

Commit 830655e

Browse files
committed
style(lib): add extra examples to connection_type in GenerationConfig and binary help
1 parent 58462ca commit 830655e

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/bin/main.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,15 @@ pub struct MainOptions {
6363
#[arg(short = 'g', long = "autogenerated-columns")]
6464
pub autogenerated_columns: Option<Vec<String>>,
6565

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

7077
/// Disable generating serde implementations

src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,12 @@ pub struct GenerationConfig<'a> {
248248
pub default_table_options: TableOptions<'a>,
249249
/// Connection type to insert
250250
///
251-
/// Example: `diesel::SqliteConnection`
251+
/// For example:
252+
/// - `diesel::pg::PgConnection`
253+
/// - `diesel::sqlite::SqliteConnection`
254+
/// - `diesel::mysql::MysqlConnection`
255+
/// - `diesel::r2d2::PooledConnection<diesel::r2d2::ConnectionManager<diesel::pg::PgConnection>>`
256+
/// - or, your custom diesel connection type (struct which implements `diesel::connection::Connection`)
252257
pub connection_type: String,
253258
/// Diesel schema import path
254259
///

0 commit comments

Comments
 (0)