Skip to content

Commit

Permalink
Add documentation for unique modifier, clean up documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Einliterflasche committed Sep 18, 2023
1 parent 10c74ff commit 3aff64e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions pg-worm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ Option | Meaning | Usage | Default
`column_name` | Set this column's name. | `#[column(column_name = "new_column_name")]` | The fields's name converted to snake case using [this crate](https://crates.io/crates/convert_case).
`primary_key` | Make this column the primary key. Only use this once per `Model`. If you want this column to be auto generated use `auto` as well. | `#[column(primary_key)]` | `false`
`auto` | Make this column auto generated. Works only for `i16`, `i32` and `i64`, as well as `Uuid` *if* the `"uuid"` feature has been enabled *and* you use PostgreSQL version 13 or later. | `#[column(auto)]` | `false`
`unique` | Add the `UNIQUE` constraint to this column | `#[column(unique)]` | `false`


## MSRV
Expand Down
1 change: 1 addition & 0 deletions pg-worm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ Option | Meaning | Usage | Default
`column_name` | Set this column's name. | `#[column(column_name = "new_column_name")]` | The fields's name converted to snake case using [this crate](https://crates.io/crates/convert_case).
`primary_key` | Make this column the primary key. Only use this once per `Model`. If you want this column to be auto generated use `auto` as well. | `#[column(primary_key)]` | `false`
`auto` | Make this column auto generated. Works only for `i16`, `i32` and `i64`, as well as `Uuid` *if* the `"uuid"` feature has been enabled *and* you use PostgreSQL version 13 or later. | `#[column(auto)]` | `false`
`unique` | Add the `UNIQUE` constraint to this column. | `#[column(unique)]` | `false`
## MSRV
Expand Down
2 changes: 1 addition & 1 deletion pg-worm/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct Connector<Tls> {
tls: Tls,
}

/// A struct for building a [`Pool`] according to your needs.
/// A struct for building a connection pool according to your needs.
pub struct ConnectionBuilder {
conn_string: String,
}
Expand Down
3 changes: 0 additions & 3 deletions pg-worm/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ where

/// A struct for storing a complete query along with
/// parameters and output type.
///
/// Depending on the output type, [`Executable`] is implemented differently
/// to allow for easy parsing.
pub struct Query<'a, T = Vec<Row>>(pub String, Vec<&'a (dyn ToSql + Sync)>, PhantomData<T>);

/// A basic chunk of SQL and it's params.
Expand Down

0 comments on commit 3aff64e

Please sign in to comment.