From 14fd6eb16cf7c443725183f693e069c9a6c0b265 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Fri, 25 Oct 2024 17:07:28 +0100 Subject: [PATCH] Rebase on our old friend main --- .../src/translation/mutation/v2/common.rs | 22 + .../src/translation/mutation/v2/delete.rs | 1 - .../src/translation/mutation/v2/insert.rs | 2 +- ...schema_tests__schema_test__get_schema.snap | 1847 +---------------- 4 files changed, 60 insertions(+), 1812 deletions(-) diff --git a/crates/query-engine/translation/src/translation/mutation/v2/common.rs b/crates/query-engine/translation/src/translation/mutation/v2/common.rs index f8edb444b..9b6ca6451 100644 --- a/crates/query-engine/translation/src/translation/mutation/v2/common.rs +++ b/crates/query-engine/translation/src/translation/mutation/v2/common.rs @@ -107,3 +107,25 @@ pub struct CheckArgument { pub fn default_constraint() -> serde_json::Value { serde_json::json!({"type": "and", "expressions": []}) } + +// the old default was to prefix generated mutations with `v2_` or `v1_` +// but now we are able to override this +pub fn get_version_prefix(mutations_prefix: &Option) -> String { + match mutations_prefix { + None => format!("{}_", super::VERSION), + Some(str) => match str.as_str() { + "" => String::new(), + _ => format!("{str}_"), + }, + } +} + +#[test] +fn test_version_prefix() { + assert_eq!(get_version_prefix(&None), "v2_".to_string()); + assert_eq!( + get_version_prefix(&Some("horse".into())), + "horse_".to_string() + ); + assert_eq!(get_version_prefix(&Some("".into())), "".to_string()); +} diff --git a/crates/query-engine/translation/src/translation/mutation/v2/delete.rs b/crates/query-engine/translation/src/translation/mutation/v2/delete.rs index 7139a31b9..f2973220f 100644 --- a/crates/query-engine/translation/src/translation/mutation/v2/delete.rs +++ b/crates/query-engine/translation/src/translation/mutation/v2/delete.rs @@ -1,6 +1,5 @@ //! Auto-generate delete mutations and translate them into sql ast. -use super::common::{self, CheckArgument}; use crate::translation::error::Error; use crate::translation::helpers::{self, TableSourceAndReference}; use crate::translation::query::filtering; diff --git a/crates/query-engine/translation/src/translation/mutation/v2/insert.rs b/crates/query-engine/translation/src/translation/mutation/v2/insert.rs index 4f69e68a5..5250053f8 100644 --- a/crates/query-engine/translation/src/translation/mutation/v2/insert.rs +++ b/crates/query-engine/translation/src/translation/mutation/v2/insert.rs @@ -11,7 +11,7 @@ use query_engine_metadata::metadata::database; use query_engine_sql::sql; use std::collections::{BTreeMap, BTreeSet}; -use super::common::{default_constraint, CheckArgument}; +use super::common::{self, default_constraint, CheckArgument}; /// A representation of an auto-generated insert mutation. /// diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap index 04c534ef5..cd7faa9e5 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__schema_tests__schema_test__get_schema.snap @@ -9901,11 +9901,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Album_by_AlbumId_response" + "name": "delete_Album_by_AlbumId_response" } }, { - "name": "v2_delete_Artist_by_ArtistId", + "name": "delete_Artist_by_ArtistId", "description": "Delete any row on the 'Artist' collection using the 'ArtistId' key", "arguments": { "key_ArtistId": { @@ -9928,11 +9928,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Artist_by_ArtistId_response" + "name": "delete_Artist_by_ArtistId_response" } }, { - "name": "v2_delete_Customer_by_CustomerId", + "name": "delete_Customer_by_CustomerId", "description": "Delete any row on the 'Customer' collection using the 'CustomerId' key", "arguments": { "key_CustomerId": { @@ -9955,11 +9955,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Customer_by_CustomerId_response" + "name": "delete_Customer_by_CustomerId_response" } }, { - "name": "v2_delete_Employee_by_EmployeeId", + "name": "delete_Employee_by_EmployeeId", "description": "Delete any row on the 'Employee' collection using the 'EmployeeId' key", "arguments": { "key_EmployeeId": { @@ -9981,11 +9981,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Employee_by_EmployeeId_response" + "name": "delete_Employee_by_EmployeeId_response" } }, { - "name": "v2_delete_Genre_by_GenreId", + "name": "delete_Genre_by_GenreId", "description": "Delete any row on the 'Genre' collection using the 'GenreId' key", "arguments": { "key_GenreId": { @@ -10007,11 +10007,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Genre_by_GenreId_response" + "name": "delete_Genre_by_GenreId_response" } }, { - "name": "v2_delete_InvoiceLine_by_InvoiceLineId", + "name": "delete_InvoiceLine_by_InvoiceLineId", "description": "Delete any row on the 'InvoiceLine' collection using the 'InvoiceLineId' key", "arguments": { "key_InvoiceLineId": { @@ -10033,11 +10033,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_InvoiceLine_by_InvoiceLineId_response" + "name": "delete_InvoiceLine_by_InvoiceLineId_response" } }, { - "name": "v2_delete_Invoice_by_InvoiceId", + "name": "delete_Invoice_by_InvoiceId", "description": "Delete any row on the 'Invoice' collection using the 'InvoiceId' key", "arguments": { "key_InvoiceId": { @@ -10059,11 +10059,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Invoice_by_InvoiceId_response" + "name": "delete_Invoice_by_InvoiceId_response" } }, { - "name": "v2_delete_MediaType_by_MediaTypeId", + "name": "delete_MediaType_by_MediaTypeId", "description": "Delete any row on the 'MediaType' collection using the 'MediaTypeId' key", "arguments": { "key_MediaTypeId": { @@ -10085,11 +10085,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_MediaType_by_MediaTypeId_response" + "name": "delete_MediaType_by_MediaTypeId_response" } }, { - "name": "v2_delete_PlaylistTrack_by_PlaylistId_and_TrackId", + "name": "delete_PlaylistTrack_by_PlaylistId_and_TrackId", "description": "Delete any row on the 'PlaylistTrack' collection using the 'PlaylistId' and 'TrackId' keys", "arguments": { "key_PlaylistId": { @@ -10117,11 +10117,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_PlaylistTrack_by_PlaylistId_and_TrackId_response" + "name": "delete_PlaylistTrack_by_PlaylistId_and_TrackId_response" } }, { - "name": "v2_delete_Playlist_by_PlaylistId", + "name": "delete_Playlist_by_PlaylistId", "description": "Delete any row on the 'Playlist' collection using the 'PlaylistId' key", "arguments": { "key_PlaylistId": { @@ -10143,11 +10143,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Playlist_by_PlaylistId_response" + "name": "delete_Playlist_by_PlaylistId_response" } }, { - "name": "v2_delete_Track_by_TrackId", + "name": "delete_Track_by_TrackId", "description": "Delete any row on the 'Track' collection using the 'TrackId' key", "arguments": { "key_TrackId": { @@ -10169,11 +10169,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_Track_by_TrackId_response" + "name": "delete_Track_by_TrackId_response" } }, { - "name": "v2_delete_custom_defaults_by_id", + "name": "delete_custom_defaults_by_id", "description": "Delete any row on the 'custom_defaults' collection using the 'id' key", "arguments": { "key_id": { @@ -10195,11 +10195,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_custom_defaults_by_id_response" + "name": "delete_custom_defaults_by_id_response" } }, { - "name": "v2_delete_custom_dog_by_id", + "name": "delete_custom_dog_by_id", "description": "Delete any row on the 'custom_dog' collection using the 'id' key", "arguments": { "key_id": { @@ -10221,11 +10221,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_custom_dog_by_id_response" + "name": "delete_custom_dog_by_id_response" } }, { - "name": "v2_delete_institution_institution_by_id", + "name": "delete_institution_institution_by_id", "description": "Delete any row on the 'institution_institution' collection using the 'id' key", "arguments": { "key_id": { @@ -10247,11 +10247,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_institution_institution_by_id_response" + "name": "delete_institution_institution_by_id_response" } }, { - "name": "v2_delete_spatial_ref_sys_by_srid", + "name": "delete_spatial_ref_sys_by_srid", "description": "Delete any row on the 'spatial_ref_sys' collection using the 'srid' key", "arguments": { "key_srid": { @@ -10273,11 +10273,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_spatial_ref_sys_by_srid_response" + "name": "delete_spatial_ref_sys_by_srid_response" } }, { - "name": "v2_delete_topology_layer_by_feature_column_and_schema_name_and_table_name", + "name": "delete_topology_layer_by_feature_column_and_schema_name_and_table_name", "description": "Delete any row on the 'topology_layer' collection using the 'feature_column', 'schema_name' and 'table_name' keys", "arguments": { "key_feature_column": { @@ -10311,11 +10311,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_topology_layer_by_feature_column_and_schema_name_and_table_name_response" + "name": "delete_topology_layer_by_feature_column_and_schema_name_and_table_name_response" } }, { - "name": "v2_delete_topology_layer_by_layer_id_and_topology_id", + "name": "delete_topology_layer_by_layer_id_and_topology_id", "description": "Delete any row on the 'topology_layer' collection using the 'layer_id' and 'topology_id' keys", "arguments": { "key_layer_id": { @@ -10343,11 +10343,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_topology_layer_by_layer_id_and_topology_id_response" + "name": "delete_topology_layer_by_layer_id_and_topology_id_response" } }, { - "name": "v2_delete_topology_topology_by_id", + "name": "delete_topology_topology_by_id", "description": "Delete any row on the 'topology_topology' collection using the 'id' key", "arguments": { "key_id": { @@ -10369,11 +10369,11 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_topology_topology_by_id_response" + "name": "delete_topology_topology_by_id_response" } }, { - "name": "v2_delete_topology_topology_by_name", + "name": "delete_topology_topology_by_name", "description": "Delete any row on the 'topology_topology' collection using the 'name' key", "arguments": { "key_name": { @@ -10395,7 +10395,7 @@ expression: result }, "result_type": { "type": "named", - "name": "v2_delete_topology_topology_by_name_response" + "name": "delete_topology_topology_by_name_response" } }, { @@ -11889,1779 +11889,6 @@ expression: result "type": "named", "name": "update_topology_topology_by_name_response" } - }, - { - "name": "v2_delete_Album_by_AlbumId", - "description": "Delete any row on the 'Album' collection using the 'AlbumId' key", - "arguments": { - "key_AlbumId": { - "description": "The identifier of an album", - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Album' collection", - "type": { - "type": "predicate", - "object_type_name": "Album" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Album_by_AlbumId_response" - } - }, - { - "name": "delete_Artist_by_ArtistId", - "description": "Delete any row on the 'Artist' collection using the 'ArtistId' key", - "arguments": { - "key_ArtistId": { - "description": "The identifier of an artist", - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Artist' collection", - "type": { - "type": "predicate", - "object_type_name": "Artist" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Artist_by_ArtistId_response" - } - }, - { - "name": "delete_Customer_by_CustomerId", - "description": "Delete any row on the 'Customer' collection using the 'CustomerId' key", - "arguments": { - "key_CustomerId": { - "description": "The identifier of customer", - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Customer' collection", - "type": { - "type": "predicate", - "object_type_name": "Customer" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Customer_by_CustomerId_response" - } - }, - { - "name": "delete_Employee_by_EmployeeId", - "description": "Delete any row on the 'Employee' collection using the 'EmployeeId' key", - "arguments": { - "key_EmployeeId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Employee' collection", - "type": { - "type": "predicate", - "object_type_name": "Employee" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Employee_by_EmployeeId_response" - } - }, - { - "name": "delete_Genre_by_GenreId", - "description": "Delete any row on the 'Genre' collection using the 'GenreId' key", - "arguments": { - "key_GenreId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Genre' collection", - "type": { - "type": "predicate", - "object_type_name": "Genre" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Genre_by_GenreId_response" - } - }, - { - "name": "delete_InvoiceLine_by_InvoiceLineId", - "description": "Delete any row on the 'InvoiceLine' collection using the 'InvoiceLineId' key", - "arguments": { - "key_InvoiceLineId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'InvoiceLine' collection", - "type": { - "type": "predicate", - "object_type_name": "InvoiceLine" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_InvoiceLine_by_InvoiceLineId_response" - } - }, - { - "name": "delete_Invoice_by_InvoiceId", - "description": "Delete any row on the 'Invoice' collection using the 'InvoiceId' key", - "arguments": { - "key_InvoiceId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Invoice' collection", - "type": { - "type": "predicate", - "object_type_name": "Invoice" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Invoice_by_InvoiceId_response" - } - }, - { - "name": "delete_MediaType_by_MediaTypeId", - "description": "Delete any row on the 'MediaType' collection using the 'MediaTypeId' key", - "arguments": { - "key_MediaTypeId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'MediaType' collection", - "type": { - "type": "predicate", - "object_type_name": "MediaType" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_MediaType_by_MediaTypeId_response" - } - }, - { - "name": "delete_PlaylistTrack_by_PlaylistId_and_TrackId", - "description": "Delete any row on the 'PlaylistTrack' collection using the 'PlaylistId' and 'TrackId' keys", - "arguments": { - "key_PlaylistId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "key_TrackId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'PlaylistTrack' collection", - "type": { - "type": "predicate", - "object_type_name": "PlaylistTrack" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_PlaylistTrack_by_PlaylistId_and_TrackId_response" - } - }, - { - "name": "delete_Playlist_by_PlaylistId", - "description": "Delete any row on the 'Playlist' collection using the 'PlaylistId' key", - "arguments": { - "key_PlaylistId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Playlist' collection", - "type": { - "type": "predicate", - "object_type_name": "Playlist" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Playlist_by_PlaylistId_response" - } - }, - { - "name": "delete_Track_by_TrackId", - "description": "Delete any row on the 'Track' collection using the 'TrackId' key", - "arguments": { - "key_TrackId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'Track' collection", - "type": { - "type": "predicate", - "object_type_name": "Track" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_Track_by_TrackId_response" - } - }, - { - "name": "delete_custom_defaults_by_id", - "description": "Delete any row on the 'custom_defaults' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int8" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'custom_defaults' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_defaults" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_custom_defaults_by_id_response" - } - }, - { - "name": "delete_custom_dog_by_id", - "description": "Delete any row on the 'custom_dog' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int8" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'custom_dog' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_dog" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_custom_dog_by_id_response" - } - }, - { - "name": "delete_institution_institution_by_id", - "description": "Delete any row on the 'institution_institution' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'institution_institution' collection", - "type": { - "type": "predicate", - "object_type_name": "institution_institution" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_institution_institution_by_id_response" - } - }, - { - "name": "delete_spatial_ref_sys_by_srid", - "description": "Delete any row on the 'spatial_ref_sys' collection using the 'srid' key", - "arguments": { - "key_srid": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'spatial_ref_sys' collection", - "type": { - "type": "predicate", - "object_type_name": "spatial_ref_sys" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_spatial_ref_sys_by_srid_response" - } - }, - { - "name": "delete_topology_layer_by_feature_column_and_schema_name_and_table_name", - "description": "Delete any row on the 'topology_layer' collection using the 'feature_column', 'schema_name' and 'table_name' keys", - "arguments": { - "key_feature_column": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "key_schema_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "key_table_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_topology_layer_by_feature_column_and_schema_name_and_table_name_response" - } - }, - { - "name": "delete_topology_layer_by_layer_id_and_topology_id", - "description": "Delete any row on the 'topology_layer' collection using the 'layer_id' and 'topology_id' keys", - "arguments": { - "key_layer_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "key_topology_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_topology_layer_by_layer_id_and_topology_id_response" - } - }, - { - "name": "delete_topology_topology_by_id", - "description": "Delete any row on the 'topology_topology' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_topology_topology_by_id_response" - } - }, - { - "name": "delete_topology_topology_by_name", - "description": "Delete any row on the 'topology_topology' collection using the 'name' key", - "arguments": { - "key_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "pre_check": { - "description": "Delete permission predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - } - }, - "result_type": { - "type": "named", - "name": "delete_topology_topology_by_name_response" - } - }, - { - "name": "insert_Album", - "description": "Insert into the Album table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Album_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Album' collection", - "type": { - "type": "predicate", - "object_type_name": "Album" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Album_response" - } - }, - { - "name": "insert_Artist", - "description": "Insert into the Artist table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Artist_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Artist' collection", - "type": { - "type": "predicate", - "object_type_name": "Artist" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Artist_response" - } - }, - { - "name": "insert_Customer", - "description": "Insert into the Customer table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Customer_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Customer' collection", - "type": { - "type": "predicate", - "object_type_name": "Customer" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Customer_response" - } - }, - { - "name": "insert_Employee", - "description": "Insert into the Employee table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Employee_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Employee' collection", - "type": { - "type": "predicate", - "object_type_name": "Employee" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Employee_response" - } - }, - { - "name": "insert_Genre", - "description": "Insert into the Genre table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Genre_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Genre' collection", - "type": { - "type": "predicate", - "object_type_name": "Genre" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Genre_response" - } - }, - { - "name": "insert_Invoice", - "description": "Insert into the Invoice table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Invoice_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Invoice' collection", - "type": { - "type": "predicate", - "object_type_name": "Invoice" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Invoice_response" - } - }, - { - "name": "insert_InvoiceLine", - "description": "Insert into the InvoiceLine table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_InvoiceLine_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'InvoiceLine' collection", - "type": { - "type": "predicate", - "object_type_name": "InvoiceLine" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_InvoiceLine_response" - } - }, - { - "name": "insert_MediaType", - "description": "Insert into the MediaType table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_MediaType_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'MediaType' collection", - "type": { - "type": "predicate", - "object_type_name": "MediaType" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_MediaType_response" - } - }, - { - "name": "insert_Playlist", - "description": "Insert into the Playlist table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Playlist_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Playlist' collection", - "type": { - "type": "predicate", - "object_type_name": "Playlist" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Playlist_response" - } - }, - { - "name": "insert_PlaylistTrack", - "description": "Insert into the PlaylistTrack table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_PlaylistTrack_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'PlaylistTrack' collection", - "type": { - "type": "predicate", - "object_type_name": "PlaylistTrack" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_PlaylistTrack_response" - } - }, - { - "name": "insert_Track", - "description": "Insert into the Track table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_Track_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'Track' collection", - "type": { - "type": "predicate", - "object_type_name": "Track" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_Track_response" - } - }, - { - "name": "insert_custom_defaults", - "description": "Insert into the custom_defaults table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_custom_defaults_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'custom_defaults' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_defaults" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_custom_defaults_response" - } - }, - { - "name": "insert_custom_dog", - "description": "Insert into the custom_dog table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_custom_dog_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'custom_dog' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_dog" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_custom_dog_response" - } - }, - { - "name": "insert_custom_test_cidr", - "description": "Insert into the custom_test_cidr table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_custom_test_cidr_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'custom_test_cidr' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_test_cidr" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_custom_test_cidr_response" - } - }, - { - "name": "insert_deck_of_cards", - "description": "Insert into the deck_of_cards table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_deck_of_cards_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'deck_of_cards' collection", - "type": { - "type": "predicate", - "object_type_name": "deck_of_cards" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_deck_of_cards_response" - } - }, - { - "name": "insert_discoverable_types_root_occurrence", - "description": "Insert into the discoverable_types_root_occurrence table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_discoverable_types_root_occurrence_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'discoverable_types_root_occurrence' collection", - "type": { - "type": "predicate", - "object_type_name": "discoverable_types_root_occurrence" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_discoverable_types_root_occurrence_response" - } - }, - { - "name": "insert_even_numbers", - "description": "Insert into the even_numbers table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_even_numbers_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'even_numbers' collection", - "type": { - "type": "predicate", - "object_type_name": "even_numbers" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_even_numbers_response" - } - }, - { - "name": "insert_group_leader", - "description": "Insert into the group_leader table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_group_leader_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'group_leader' collection", - "type": { - "type": "predicate", - "object_type_name": "group_leader" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_group_leader_response" - } - }, - { - "name": "insert_institution_institution", - "description": "Insert into the institution_institution table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_institution_institution_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'institution_institution' collection", - "type": { - "type": "predicate", - "object_type_name": "institution_institution" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_institution_institution_response" - } - }, - { - "name": "insert_phone_numbers", - "description": "Insert into the phone_numbers table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_phone_numbers_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'phone_numbers' collection", - "type": { - "type": "predicate", - "object_type_name": "phone_numbers" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_phone_numbers_response" - } - }, - { - "name": "insert_spatial_ref_sys", - "description": "Insert into the spatial_ref_sys table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_spatial_ref_sys_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'spatial_ref_sys' collection", - "type": { - "type": "predicate", - "object_type_name": "spatial_ref_sys" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_spatial_ref_sys_response" - } - }, - { - "name": "insert_topology_layer", - "description": "Insert into the topology_layer table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_topology_layer_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_topology_layer_response" - } - }, - { - "name": "insert_topology_topology", - "description": "Insert into the topology_topology table", - "arguments": { - "objects": { - "type": { - "type": "array", - "element_type": { - "type": "named", - "name": "insert_topology_topology_object" - } - } - }, - "post_check": { - "description": "Insert permission predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - } - }, - "result_type": { - "type": "named", - "name": "insert_topology_topology_response" - } - }, - { - "name": "update_Album_by_AlbumId", - "description": "Update any row on the 'Album' collection using the 'AlbumId' key", - "arguments": { - "key_AlbumId": { - "description": "The identifier of an album", - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Album' collection", - "type": { - "type": "predicate", - "object_type_name": "Album" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Album' collection", - "type": { - "type": "predicate", - "object_type_name": "Album" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Album_by_AlbumId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Album_by_AlbumId_response" - } - }, - { - "name": "update_Artist_by_ArtistId", - "description": "Update any row on the 'Artist' collection using the 'ArtistId' key", - "arguments": { - "key_ArtistId": { - "description": "The identifier of an artist", - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Artist' collection", - "type": { - "type": "predicate", - "object_type_name": "Artist" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Artist' collection", - "type": { - "type": "predicate", - "object_type_name": "Artist" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Artist_by_ArtistId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Artist_by_ArtistId_response" - } - }, - { - "name": "update_Customer_by_CustomerId", - "description": "Update any row on the 'Customer' collection using the 'CustomerId' key", - "arguments": { - "key_CustomerId": { - "description": "The identifier of customer", - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Customer' collection", - "type": { - "type": "predicate", - "object_type_name": "Customer" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Customer' collection", - "type": { - "type": "predicate", - "object_type_name": "Customer" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Customer_by_CustomerId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Customer_by_CustomerId_response" - } - }, - { - "name": "update_Employee_by_EmployeeId", - "description": "Update any row on the 'Employee' collection using the 'EmployeeId' key", - "arguments": { - "key_EmployeeId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Employee' collection", - "type": { - "type": "predicate", - "object_type_name": "Employee" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Employee' collection", - "type": { - "type": "predicate", - "object_type_name": "Employee" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Employee_by_EmployeeId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Employee_by_EmployeeId_response" - } - }, - { - "name": "update_Genre_by_GenreId", - "description": "Update any row on the 'Genre' collection using the 'GenreId' key", - "arguments": { - "key_GenreId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Genre' collection", - "type": { - "type": "predicate", - "object_type_name": "Genre" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Genre' collection", - "type": { - "type": "predicate", - "object_type_name": "Genre" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Genre_by_GenreId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Genre_by_GenreId_response" - } - }, - { - "name": "update_InvoiceLine_by_InvoiceLineId", - "description": "Update any row on the 'InvoiceLine' collection using the 'InvoiceLineId' key", - "arguments": { - "key_InvoiceLineId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'InvoiceLine' collection", - "type": { - "type": "predicate", - "object_type_name": "InvoiceLine" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'InvoiceLine' collection", - "type": { - "type": "predicate", - "object_type_name": "InvoiceLine" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_InvoiceLine_by_InvoiceLineId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_InvoiceLine_by_InvoiceLineId_response" - } - }, - { - "name": "update_Invoice_by_InvoiceId", - "description": "Update any row on the 'Invoice' collection using the 'InvoiceId' key", - "arguments": { - "key_InvoiceId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Invoice' collection", - "type": { - "type": "predicate", - "object_type_name": "Invoice" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Invoice' collection", - "type": { - "type": "predicate", - "object_type_name": "Invoice" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Invoice_by_InvoiceId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Invoice_by_InvoiceId_response" - } - }, - { - "name": "update_MediaType_by_MediaTypeId", - "description": "Update any row on the 'MediaType' collection using the 'MediaTypeId' key", - "arguments": { - "key_MediaTypeId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'MediaType' collection", - "type": { - "type": "predicate", - "object_type_name": "MediaType" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'MediaType' collection", - "type": { - "type": "predicate", - "object_type_name": "MediaType" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_MediaType_by_MediaTypeId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_MediaType_by_MediaTypeId_response" - } - }, - { - "name": "update_PlaylistTrack_by_PlaylistId_and_TrackId", - "description": "Update any row on the 'PlaylistTrack' collection using the 'PlaylistId' and 'TrackId' keys", - "arguments": { - "key_PlaylistId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "key_TrackId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'PlaylistTrack' collection", - "type": { - "type": "predicate", - "object_type_name": "PlaylistTrack" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'PlaylistTrack' collection", - "type": { - "type": "predicate", - "object_type_name": "PlaylistTrack" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_PlaylistTrack_by_PlaylistId_and_TrackId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_PlaylistTrack_by_PlaylistId_and_TrackId_response" - } - }, - { - "name": "update_Playlist_by_PlaylistId", - "description": "Update any row on the 'Playlist' collection using the 'PlaylistId' key", - "arguments": { - "key_PlaylistId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Playlist' collection", - "type": { - "type": "predicate", - "object_type_name": "Playlist" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Playlist' collection", - "type": { - "type": "predicate", - "object_type_name": "Playlist" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Playlist_by_PlaylistId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Playlist_by_PlaylistId_response" - } - }, - { - "name": "update_Track_by_TrackId", - "description": "Update any row on the 'Track' collection using the 'TrackId' key", - "arguments": { - "key_TrackId": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'Track' collection", - "type": { - "type": "predicate", - "object_type_name": "Track" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'Track' collection", - "type": { - "type": "predicate", - "object_type_name": "Track" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_Track_by_TrackId_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_Track_by_TrackId_response" - } - }, - { - "name": "update_custom_defaults_by_id", - "description": "Update any row on the 'custom_defaults' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int8" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'custom_defaults' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_defaults" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'custom_defaults' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_defaults" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_custom_defaults_by_id_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_custom_defaults_by_id_response" - } - }, - { - "name": "update_custom_dog_by_id", - "description": "Update any row on the 'custom_dog' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int8" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'custom_dog' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_dog" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'custom_dog' collection", - "type": { - "type": "predicate", - "object_type_name": "custom_dog" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_custom_dog_by_id_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_custom_dog_by_id_response" - } - }, - { - "name": "update_institution_institution_by_id", - "description": "Update any row on the 'institution_institution' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'institution_institution' collection", - "type": { - "type": "predicate", - "object_type_name": "institution_institution" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'institution_institution' collection", - "type": { - "type": "predicate", - "object_type_name": "institution_institution" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_institution_institution_by_id_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_institution_institution_by_id_response" - } - }, - { - "name": "update_spatial_ref_sys_by_srid", - "description": "Update any row on the 'spatial_ref_sys' collection using the 'srid' key", - "arguments": { - "key_srid": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'spatial_ref_sys' collection", - "type": { - "type": "predicate", - "object_type_name": "spatial_ref_sys" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'spatial_ref_sys' collection", - "type": { - "type": "predicate", - "object_type_name": "spatial_ref_sys" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_spatial_ref_sys_by_srid_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_spatial_ref_sys_by_srid_response" - } - }, - { - "name": "update_topology_layer_by_feature_column_and_schema_name_and_table_name", - "description": "Update any row on the 'topology_layer' collection using the 'feature_column', 'schema_name' and 'table_name' keys", - "arguments": { - "key_feature_column": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "key_schema_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "key_table_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_topology_layer_by_feature_column_and_schema_name_and_table_name_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_topology_layer_by_feature_column_and_schema_name_and_table_name_response" - } - }, - { - "name": "update_topology_layer_by_layer_id_and_topology_id", - "description": "Update any row on the 'topology_layer' collection using the 'layer_id' and 'topology_id' keys", - "arguments": { - "key_layer_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "key_topology_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'topology_layer' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_layer" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_topology_layer_by_layer_id_and_topology_id_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_topology_layer_by_layer_id_and_topology_id_response" - } - }, - { - "name": "update_topology_topology_by_id", - "description": "Update any row on the 'topology_topology' collection using the 'id' key", - "arguments": { - "key_id": { - "type": { - "type": "named", - "name": "int4" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_topology_topology_by_id_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_topology_topology_by_id_response" - } - }, - { - "name": "update_topology_topology_by_name", - "description": "Update any row on the 'topology_topology' collection using the 'name' key", - "arguments": { - "key_name": { - "type": { - "type": "named", - "name": "varchar" - } - }, - "post_check": { - "description": "Update permission post-condition predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - }, - "pre_check": { - "description": "Update permission pre-condition predicate over the 'topology_topology' collection", - "type": { - "type": "predicate", - "object_type_name": "topology_topology" - } - }, - "update_columns": { - "type": { - "type": "named", - "name": "update_topology_topology_by_name_update_columns" - } - } - }, - "result_type": { - "type": "named", - "name": "update_topology_topology_by_name_response" - } } ] }