diff --git a/crates/query-engine/execution/src/database_info.rs b/crates/query-engine/execution/src/database_info.rs index e713cc9f..7ec5afd2 100644 --- a/crates/query-engine/execution/src/database_info.rs +++ b/crates/query-engine/execution/src/database_info.rs @@ -29,8 +29,11 @@ pub struct DatabaseInfo { pub struct DatabaseVersion { /// The database system version, as reported by `SELECT version()`. /// This is typically a long string of unspecified format, e.g. + /// /// > PostgreSQL 16.0 (Debian 16.0-1.pgdg120+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit + /// /// or: + /// /// > CockroachDB CCL v22.2.14 (aarch64-unknown-linux-gnu, built 2023/09/14 19:23:08, go1.19.6) pub string: Option, /// The database system version, in the libpq format, as reported by `SHOW server_version_num`. diff --git a/crates/query-engine/sql/src/sql/ast.rs b/crates/query-engine/sql/src/sql/ast.rs index 2eea2a27..871ed4d5 100644 --- a/crates/query-engine/sql/src/sql/ast.rs +++ b/crates/query-engine/sql/src/sql/ast.rs @@ -366,12 +366,12 @@ pub enum Value { /// This has a few quirks: /// /// * Array types need to be quoted as `"type name"[]` and _not_ `"type name[]"`. Therefore we -/// track whether a scalar type is supposed to be an array. +/// track whether a scalar type is supposed to be an array. /// /// * Quoting of type name identifiers is only supported for the actual type names recorded in -/// `pg_type`, and _not_ the SQL standard type names. This means that `character varying` is an -/// acceptable type name, but `"character varying"` is _not_ (Unless of course you do `CREATE TYPE -/// "character varying" AS (..)`. Spicy). +/// `pg_type`, and _not_ the SQL standard type names. This means that `character varying` is an +/// acceptable type name, but `"character varying"` is _not_ (Unless of course you do `CREATE TYPE +/// "character varying" AS (..)`. Spicy). #[derive(Debug, Clone, PartialEq)] pub enum ScalarType { BaseType(ScalarTypeName), diff --git a/crates/query-engine/sql/src/sql/helpers.rs b/crates/query-engine/sql/src/sql/helpers.rs index 04f66e8c..ee1b1ae2 100644 --- a/crates/query-engine/sql/src/sql/helpers.rs +++ b/crates/query-engine/sql/src/sql/helpers.rs @@ -583,8 +583,8 @@ pub fn select_row_as_json( /// - `json_agg` aggregates the json objects to a json array. /// - `coalesce(, )` returns `` if it is not null, and `` if it is null. /// - `json_build_object('__value', )` wraps `` in an object as a value to the key '__value' -/// as expected in ndc-spec: -/// +/// as expected in ndc-spec: +/// pub fn select_rows_as_json_for_mutation( row_select: Select, column_alias: ColumnAlias, diff --git a/crates/query-engine/translation/src/translation/mutation/v2/mod.rs b/crates/query-engine/translation/src/translation/mutation/v2/mod.rs index 9613f330..2ab33549 100644 --- a/crates/query-engine/translation/src/translation/mutation/v2/mod.rs +++ b/crates/query-engine/translation/src/translation/mutation/v2/mod.rs @@ -6,22 +6,27 @@ //! * We generate delete, insert and update procedures for each table. //! //! * A single insert procedure is generated per table of the form: +//! //! > v2_insert_( //! > objects: [], //! > post_check: //! > ) +//! //! It allows us to insert multiple objects and include a post check for permissions. //! //! * A delete procedure is generated per table X unique constraint of the form: +//! //! > v2_delete_
_by_( //! > key_: , //! > key_: , //! > ..., //! > pre_check: //! > ) +//! //! It allows us to delete a single row using the uniqueness constraint, and contains a boolexpr for permissions. //! //! * An update procedure is generated per table X unique constraint of the form: +//! //! > v2_update_
_by_( //! > key_: , //! > key_: , @@ -30,6 +35,7 @@ //! > pre_check: , //! > post_check: //! > ) +//! //! It allows us to update a single row using the uniqueness constraint by updating the relevant columns, //! and contains a pre check and post check for permissions. //! diff --git a/flake.nix b/flake.nix index ffa5329a..a80c6e4b 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,7 @@ pkgs.moreutils # Rust + pkgs.bacon pkgs.cargo-audit pkgs.cargo-edit pkgs.cargo-expand