diff --git a/src/cake/internal/query.gleam b/src/cake/internal/query.gleam index aa973e9..8ba17d9 100644 --- a/src/cake/internal/query.gleam +++ b/src/cake/internal/query.gleam @@ -33,6 +33,8 @@ // TODO: Add to query validator in v2 or v3 +// TODO v1 doc all public types, consts and functions in internal modules + import cake/dialect.{type Dialect, Maria, Postgres, Sqlite} import cake/internal/prepared_statement.{type PreparedStatement} import cake/param.{type Param} @@ -1263,11 +1265,10 @@ pub fn comment_apply( /// Fragments are used to insert raw SQL into the query. /// /// NOTICE: Injecting input data into fragments is only safe when using -/// `FragmentPrepared` and only using literal strings in the `fragment` -/// field. +/// `FragmentPrepared` and only using literal strings in the `fragment` field. /// -/// As a strategy it is recommended to ALWAYS USE MODULE CONSTANTS for -/// any `fragment`-field string. +/// As a strategy it is recommended to ALWAYS USE MODULE CONSTANTS for +/// any `fragment`-field string. /// pub type Fragment { FragmentLiteral(fragment: String) diff --git a/src/cake/query/delete.gleam b/src/cake/query/delete.gleam index 03510f8..49ff677 100644 --- a/src/cake/query/delete.gleam +++ b/src/cake/query/delete.gleam @@ -223,9 +223,9 @@ pub fn or_where(query qry: Delete(a), where whr: Where) -> Delete(a) { /// - If the outermost `Where` is any other kind of `Where`, this and the /// current outermost `Where` are wrapped in an `XorWhere`. /// -/// NOTICE: This operator does not exist in Postgres or Sqlite, -/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. -/// This operator exists in MariaDB/MySQL. +/// NOTICE: This operator does not exist in Postgres or Sqlite, and *Cake* +/// generates equivalent SQL using `OR` and `AND` and `NOT`. +/// This operator exists in MariaDB/MySQL. /// pub fn xor_where(query qry: Delete(a), where whr: Where) -> Delete(a) { case qry.where { diff --git a/src/cake/query/insert.gleam b/src/cake/query/insert.gleam index 9264e98..be7ccdd 100644 --- a/src/cake/query/insert.gleam +++ b/src/cake/query/insert.gleam @@ -173,8 +173,8 @@ pub fn get_source(query qry: Insert(a)) -> InsertSource(a) { /// Specify the columns to insert into. /// /// NOTICE: You have to specify the columns and keep track if their names are -/// correct, as well as their count which must be equal to the count of -/// `InsertRows` the caster function returns or is given as source +/// correct, as well as their count which must be equal to the count of +/// `InsertRows` the caster function returns or is given as source /// values. /// pub fn columns(query qry: Insert(a), columns cols: List(String)) -> Insert(a) { diff --git a/src/cake/query/select.gleam b/src/cake/query/select.gleam index 835fe53..2a2357a 100644 --- a/src/cake/query/select.gleam +++ b/src/cake/query/select.gleam @@ -293,8 +293,8 @@ pub fn or_where(query qry: Select, where whr: Where) -> Select { /// current outermost `Where` are wrapped in an `XorWhere`. /// /// NOTICE: This operator does not exist in Postgres or Sqlite, -/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. -/// This operator exists in MariaDB/MySQL. +/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. +/// This operator exists in MariaDB/MySQL. /// pub fn xor_where(query qry: Select, where whr: Where) -> Select { case qry.where { @@ -334,9 +334,9 @@ pub fn get_where(query qry: Select) -> Where { /// - If the outermost `Where` is any other kind of `Where`, this and the /// current outermost `Where` are wrapped in an `AndWhere`. /// -/// NOTICE: `HAVING` allows to specify constraints much like `WHERE`, -/// but filters the results after `GROUP BY` is applied instead of -/// before. Because `HAVING` uses the same semantics as `WHERE`, it +/// NOTICE: `HAVING` allows to specify constraints much like `WHERE`, but +/// filters the results after `GROUP BY` is applied instead of before. Because +/// `HAVING` uses the same semantics as `WHERE`, it /// takes a `Where`. /// pub fn having(query qry: Select, having whr: Where) -> Select { @@ -380,8 +380,8 @@ pub fn or_having(query qry: Select, having whr: Where) -> Select { /// See function `having` on details why this takes a `Where`. /// /// NOTICE: This operator does not exist in Postgres or Sqlite, -/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. -/// This operator exists in MariaDB/MySQL. +/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. +/// This operator exists in MariaDB/MySQL. /// pub fn xor_having(query qry: Select, having whr: Where) -> Select { case qry.having { diff --git a/src/cake/query/update.gleam b/src/cake/query/update.gleam index cc42e86..cec563a 100644 --- a/src/cake/query/update.gleam +++ b/src/cake/query/update.gleam @@ -246,8 +246,8 @@ pub fn or_where(query qry: Update(a), where whr: Where) -> Update(a) { /// current outermost `Where` are wrapped in an `XorWhere`. /// /// NOTICE: This operator does not exist in Postgres or Sqlite, -/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. -/// This operator exists in MariaDB/MySQL. +/// and *Cake* generates equivalent SQL using `OR` and `AND` and `NOT`. +/// This operator exists in MariaDB/MySQL. /// pub fn xor_where(query qry: Update(a), where whr: Where) -> Update(a) { case qry.where { @@ -279,7 +279,7 @@ pub fn get_where(query qry: Update(a)) -> Where { // ▒▒▒ RETURNING ▒▒▒ /// NOTICE: MariaDB/MySQL do not support `RETURNING` in `UPDATE` queries; -/// they do support it in `INSERT` (and `REPLACE`) queries, however. +/// they do support it in `INSERT` (and `REPLACE`) queries, however. /// pub fn returning( query qry: Update(a), @@ -292,7 +292,7 @@ pub fn returning( } /// NOTICE: MariaDB/MySQL do not support `RETURNING` in `UPDATE` queries; -/// they do support it in `INSERT` (and `REPLACE`) queries, however. +/// they do support it in `INSERT` (and `REPLACE`) queries, however. /// pub fn no_returning(query qry: Update(a)) -> Update(a) { Update(..qry, returning: NoReturning)