Skip to content

Commit

Permalink
Fix warnings flagged by the new Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamirTalwar committed Aug 22, 2024
1 parent 8e23a9e commit 4f064ff
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions crates/query-engine/execution/src/database_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
/// The database system version, in the libpq format, as reported by `SHOW server_version_num`.
Expand Down
8 changes: 4 additions & 4 deletions crates/query-engine/sql/src/sql/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions crates/query-engine/sql/src/sql/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ pub fn select_row_as_json(
/// - `json_agg` aggregates the json objects to a json array.
/// - `coalesce(<thing>, <otherwise>)` returns `<thing>` if it is not null, and `<otherwise>` if it is null.
/// - `json_build_object('__value', <thing>)` wraps `<thing>` in an object as a value to the key '__value'
/// as expected in ndc-spec:
/// <https://hasura.github.io/ndc-spec/specification/mutations/procedures.html#requirements>
/// as expected in ndc-spec:
/// <https://hasura.github.io/ndc-spec/specification/mutations/procedures.html#requirements>
pub fn select_rows_as_json_for_mutation(
row_select: Select,
column_alias: ColumnAlias,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_<table>(
//! > objects: [<object>],
//! > post_check: <boolexpr>
//! > )
//!
//! 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_<table>_by_<column_and_...>(
//! > key_<column1>: <value>,
//! > key_<column2>: <value>,
//! > ...,
//! > pre_check: <boolexpr>
//! > )
//!
//! 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_<table>_by_<column_and_...>(
//! > key_<column1>: <value>,
//! > key_<column2>: <value>,
Expand All @@ -30,6 +35,7 @@
//! > pre_check: <boolexpr>,
//! > post_check: <boolexpr>
//! > )
//!
//! 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.
//!
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
pkgs.moreutils

# Rust
pkgs.bacon
pkgs.cargo-audit
pkgs.cargo-edit
pkgs.cargo-expand
Expand Down

0 comments on commit 4f064ff

Please sign in to comment.