From fd338e7563abaae762aa03829ad0b3e7cc5dacd3 Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Fri, 5 Apr 2024 16:08:21 +0300 Subject: [PATCH 1/6] ndc-spec 0.1.2 --- Cargo.lock | 24 +- Cargo.toml | 6 +- crates/configuration/src/version3/mod.rs | 24 +- crates/connectors/ndc-postgres/src/schema.rs | 55 +- .../metadata/src/metadata/database.rs | 28 + ...schema_tests__schema_test__get_schema.snap | 22 +- ...schema_tests__schema_test__get_schema.snap | 20 +- ...ation_tests__get_configuration_schema.snap | 98 + ...tests__get_rawconfiguration_v3_schema.snap | 98 + ...v3_initial_configuration_is_unchanged.snap | 16 +- ..._openapi__up_to_date_generated_schema.snap | 98 + ...schema_tests__schema_test__get_schema.snap | 22 +- crates/tests/tests-common/Cargo.toml | 2 +- .../src/common_tests/ndc_tests.rs | 35 +- crates/tests/tests-common/src/request.rs | 2 +- .../configuration.json | 24 +- .../configuration.json | 26 +- .../configuration.json | 24 +- .../configuration.json | 3952 +++++++++++++++++ .../summarize_organizations.sql | 22 + .../configuration.json | 6 +- .../configuration.json | 26 +- static/schema.json | 70 + .../configuration.json | 26 +- 24 files changed, 4554 insertions(+), 172 deletions(-) create mode 100644 static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json create mode 100644 static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql diff --git a/Cargo.lock b/Cargo.lock index eb086f944..1441875d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1426,20 +1426,15 @@ dependencies = [ ] [[package]] -name = "ndc-client" -version = "0.1.1" -source = "git+https://github.com/hasura/ndc-spec.git?tag=v0.1.1#17c61946cc9a3ff6dcee1d535af33141213b639a" +name = "ndc-models" +version = "0.1.2" +source = "git+https://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" dependencies = [ - "async-trait", "indexmap 2.2.6", - "opentelemetry", - "reqwest", "schemars", "serde", - "serde_derive", "serde_json", "serde_with", - "url", ] [[package]] @@ -1499,7 +1494,7 @@ dependencies = [ [[package]] name = "ndc-sdk" version = "0.1.0" -source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=7b56fac3aba2bc6533d3163111377fd5fbeb3011#7b56fac3aba2bc6533d3163111377fd5fbeb3011" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=caed508bd97ed6d733d5b6c45c91349315379db1#caed508bd97ed6d733d5b6c45c91349315379db1" dependencies = [ "async-trait", "axum", @@ -1508,7 +1503,7 @@ dependencies = [ "clap", "http", "mime", - "ndc-client", + "ndc-models", "ndc-test", "opentelemetry", "opentelemetry-http", @@ -1530,14 +1525,14 @@ dependencies = [ [[package]] name = "ndc-test" -version = "0.1.1" -source = "git+https://github.com/hasura/ndc-spec.git?tag=v0.1.1#17c61946cc9a3ff6dcee1d535af33141213b639a" +version = "0.1.2" +source = "git+https://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" dependencies = [ "async-trait", "clap", "colorful", "indexmap 2.2.6", - "ndc-client", + "ndc-models", "rand", "reqwest", "semver", @@ -1545,6 +1540,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", + "url", ] [[package]] @@ -3064,7 +3060,7 @@ dependencies = [ "env_logger", "hyper", "jsonschema", - "ndc-client", + "ndc-models", "ndc-postgres", "ndc-postgres-configuration", "ndc-sdk", diff --git a/Cargo.toml b/Cargo.toml index 30b1482ce..c64284fc3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,6 @@ unreadable_literal = "allow" unused_async = "allow" [workspace.dependencies] -ndc-client = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.1" } -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "7b56fac3aba2bc6533d3163111377fd5fbeb3011" } -ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.1" } +ndc-models = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "caed508bd97ed6d733d5b6c45c91349315379db1" } +ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } diff --git a/crates/configuration/src/version3/mod.rs b/crates/configuration/src/version3/mod.rs index a4cfbb53d..5a90bf57d 100644 --- a/crates/configuration/src/version3/mod.rs +++ b/crates/configuration/src/version3/mod.rs @@ -222,11 +222,11 @@ fn base_type_representations() -> database::TypeRepresentations { ), ( database::ScalarType("date".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::Date, ), ( database::ScalarType("float4".to_string()), - database::TypeRepresentation::Number, + database::TypeRepresentation::Float32, ), // Note that we default wide numerical types to Number/Integer because any column of such type // that PostgreSQL outputs as json will still be using numbers, and there is nothing we can @@ -241,23 +241,23 @@ fn base_type_representations() -> database::TypeRepresentations { // See for instance https://neon.tech/blog/parsing-json-from-postgres-in-js. ( database::ScalarType("float8".to_string()), - database::TypeRepresentation::Number, + database::TypeRepresentation::Float64, ), ( database::ScalarType("int2".to_string()), - database::TypeRepresentation::Integer, + database::TypeRepresentation::Int16, ), ( database::ScalarType("int4".to_string()), - database::TypeRepresentation::Integer, + database::TypeRepresentation::Int32, ), ( database::ScalarType("int8".to_string()), - database::TypeRepresentation::Integer, + database::TypeRepresentation::Int64, ), ( database::ScalarType("numeric".to_string()), - database::TypeRepresentation::Number, + database::TypeRepresentation::BigDecimal, ), ( database::ScalarType("text".to_string()), @@ -265,23 +265,23 @@ fn base_type_representations() -> database::TypeRepresentations { ), ( database::ScalarType("time".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::Time, ), ( database::ScalarType("timestamp".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::Timestamp, ), ( database::ScalarType("timestamptz".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::Timestamptz, ), ( database::ScalarType("timetz".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::Timetz, ), ( database::ScalarType("uuid".to_string()), - database::TypeRepresentation::String, + database::TypeRepresentation::UUID, ), ( database::ScalarType("varchar".to_string()), diff --git a/crates/connectors/ndc-postgres/src/schema.rs b/crates/connectors/ndc-postgres/src/schema.rs index f1e924539..c09fa6401 100644 --- a/crates/connectors/ndc-postgres/src/schema.rs +++ b/crates/connectors/ndc-postgres/src/schema.rs @@ -29,23 +29,11 @@ pub async fn get_schema( .into_iter() .map(|scalar_type| { let result = models::ScalarType { - representation: metadata.type_representations.0.get(&scalar_type).map( - |type_representation| match type_representation { - metadata::TypeRepresentation::Boolean => { - models::TypeRepresentation::Boolean - } - metadata::TypeRepresentation::Integer => { - models::TypeRepresentation::Integer - } - metadata::TypeRepresentation::Number => models::TypeRepresentation::Number, - metadata::TypeRepresentation::String => models::TypeRepresentation::String, - metadata::TypeRepresentation::Enum(variants) => { - models::TypeRepresentation::Enum { - one_of: variants.clone(), - } - } - }, - ), + representation: metadata + .type_representations + .0 + .get(&scalar_type) + .map(map_type_representation), aggregate_functions: metadata .aggregate_functions .0 @@ -584,7 +572,7 @@ fn make_procedure_type( scalar_types .entry("int4".to_string()) .or_insert(models::ScalarType { - representation: Some(models::TypeRepresentation::Integer), + representation: Some(models::TypeRepresentation::Int32), aggregate_functions: BTreeMap::new(), comparison_operators: BTreeMap::new(), }); @@ -626,3 +614,34 @@ fn make_procedure_type( }, } } + +fn map_type_representation( + type_representation: &metadata::TypeRepresentation, +) -> models::TypeRepresentation { + match type_representation { + metadata::TypeRepresentation::Integer => models::TypeRepresentation::Int32, + metadata::TypeRepresentation::Number => models::TypeRepresentation::Float64, + metadata::TypeRepresentation::Boolean => models::TypeRepresentation::Boolean, + metadata::TypeRepresentation::String => models::TypeRepresentation::String, + metadata::TypeRepresentation::Float32 => models::TypeRepresentation::Float32, + metadata::TypeRepresentation::Float64 => models::TypeRepresentation::Float64, + metadata::TypeRepresentation::Int16 => models::TypeRepresentation::Int16, + metadata::TypeRepresentation::Int32 => models::TypeRepresentation::Int32, + // ndc-spec defines that Int64 has the json representation of a string. + // This is not what we do now and is a breaking change. + // This will need to be changed in the future. + metadata::TypeRepresentation::Int64 => models::TypeRepresentation::Int32, + metadata::TypeRepresentation::BigDecimal => models::TypeRepresentation::BigDecimal, + metadata::TypeRepresentation::Timestamp => models::TypeRepresentation::Timestamp, + metadata::TypeRepresentation::Timestamptz => models::TypeRepresentation::TimestampTZ, + metadata::TypeRepresentation::Time => models::TypeRepresentation::String, + metadata::TypeRepresentation::Timetz => models::TypeRepresentation::String, + metadata::TypeRepresentation::Date => models::TypeRepresentation::Date, + metadata::TypeRepresentation::Geometry => models::TypeRepresentation::Geometry, + metadata::TypeRepresentation::Geography => models::TypeRepresentation::Geography, + metadata::TypeRepresentation::UUID => models::TypeRepresentation::UUID, + metadata::TypeRepresentation::Enum(variants) => models::TypeRepresentation::Enum { + one_of: variants.clone(), + }, + } +} diff --git a/crates/query-engine/metadata/src/metadata/database.rs b/crates/query-engine/metadata/src/metadata/database.rs index a38a7d6b8..7907eb047 100644 --- a/crates/query-engine/metadata/src/metadata/database.rs +++ b/crates/query-engine/metadata/src/metadata/database.rs @@ -217,6 +217,34 @@ pub enum TypeRepresentation { Boolean, /// Any JSON string String, + /// float4 + Float32, + /// float8 + Float64, + /// int2 + Int16, + /// int4 + Int32, + /// int8 + Int64, + /// numeric + BigDecimal, + /// timestamp + Timestamp, + /// timestamp with timezone + Timestamptz, + /// time + Time, + /// time with timezone + Timetz, + /// date + Date, + /// uuid + UUID, + /// geography + Geography, + /// geometry + Geometry, /// Any JSON number Number, /// Any JSON number, with no decimal part diff --git a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap index 2994356e8..51e82e268 100644 --- a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap @@ -606,7 +606,7 @@ expression: result }, "date": { "representation": { - "type": "string" + "type": "date" }, "aggregate_functions": { "max": { @@ -668,7 +668,7 @@ expression: result }, "even_number": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -796,7 +796,7 @@ expression: result }, "float4": { "representation": { - "type": "number" + "type": "float32" }, "aggregate_functions": { "avg": { @@ -906,7 +906,7 @@ expression: result }, "float8": { "representation": { - "type": "number" + "type": "float64" }, "aggregate_functions": { "avg": { @@ -1016,7 +1016,7 @@ expression: result }, "int2": { "representation": { - "type": "integer" + "type": "int16" }, "aggregate_functions": { "avg": { @@ -1144,7 +1144,7 @@ expression: result }, "int4": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -1272,7 +1272,7 @@ expression: result }, "int8": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -1471,7 +1471,7 @@ expression: result }, "numeric": { "representation": { - "type": "number" + "type": "bigdecimal" }, "aggregate_functions": { "avg": { @@ -1787,7 +1787,7 @@ expression: result }, "timestamp": { "representation": { - "type": "string" + "type": "timestamp" }, "aggregate_functions": { "max": { @@ -1849,7 +1849,7 @@ expression: result }, "timestamptz": { "representation": { - "type": "string" + "type": "timestamptz" }, "aggregate_functions": { "max": { @@ -1973,7 +1973,7 @@ expression: result }, "uuid": { "representation": { - "type": "string" + "type": "uuid" }, "aggregate_functions": {}, "comparison_operators": { diff --git a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap index e50a28845..4379f4848 100644 --- a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap @@ -296,7 +296,7 @@ expression: result }, "date": { "representation": { - "type": "string" + "type": "date" }, "aggregate_functions": {}, "comparison_operators": { @@ -345,7 +345,7 @@ expression: result }, "float4": { "representation": { - "type": "number" + "type": "float32" }, "aggregate_functions": { "avg": { @@ -449,7 +449,7 @@ expression: result }, "float8": { "representation": { - "type": "number" + "type": "float64" }, "aggregate_functions": { "avg": { @@ -553,7 +553,7 @@ expression: result }, "int2": { "representation": { - "type": "integer" + "type": "int16" }, "aggregate_functions": { "avg": { @@ -681,7 +681,7 @@ expression: result }, "int4": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -809,7 +809,7 @@ expression: result }, "int8": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -996,7 +996,7 @@ expression: result }, "numeric": { "representation": { - "type": "number" + "type": "bigdecimal" }, "aggregate_functions": { "avg": { @@ -1316,7 +1316,7 @@ expression: result }, "timestamp": { "representation": { - "type": "string" + "type": "timestamp" }, "aggregate_functions": {}, "comparison_operators": { @@ -1365,7 +1365,7 @@ expression: result }, "timestamptz": { "representation": { - "type": "string" + "type": "timestamptz" }, "aggregate_functions": {}, "comparison_operators": { @@ -1463,7 +1463,7 @@ expression: result }, "uuid": { "representation": { - "type": "string" + "type": "uuid" }, "aggregate_functions": {}, "comparison_operators": { diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap index 82cec553b..31fa8addc 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap @@ -1000,6 +1000,104 @@ expression: schema "string" ] }, + { + "description": "float4", + "type": "string", + "enum": [ + "float32" + ] + }, + { + "description": "float8", + "type": "string", + "enum": [ + "float64" + ] + }, + { + "description": "int2", + "type": "string", + "enum": [ + "int16" + ] + }, + { + "description": "int4", + "type": "string", + "enum": [ + "int32" + ] + }, + { + "description": "int8", + "type": "string", + "enum": [ + "int64" + ] + }, + { + "description": "numeric", + "type": "string", + "enum": [ + "bigDecimal" + ] + }, + { + "description": "timestamp", + "type": "string", + "enum": [ + "timestamp" + ] + }, + { + "description": "timestamp with timezone", + "type": "string", + "enum": [ + "timestamptz" + ] + }, + { + "description": "time", + "type": "string", + "enum": [ + "time" + ] + }, + { + "description": "time with timezone", + "type": "string", + "enum": [ + "timetz" + ] + }, + { + "description": "date", + "type": "string", + "enum": [ + "date" + ] + }, + { + "description": "uuid", + "type": "string", + "enum": [ + "uUID" + ] + }, + { + "description": "geography", + "type": "string", + "enum": [ + "geography" + ] + }, + { + "description": "geometry", + "type": "string", + "enum": [ + "geometry" + ] + }, { "description": "Any JSON number", "type": "string", diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap index c6fc2ac44..78dd85d84 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap @@ -988,6 +988,104 @@ expression: schema "string" ] }, + { + "description": "float4", + "type": "string", + "enum": [ + "float32" + ] + }, + { + "description": "float8", + "type": "string", + "enum": [ + "float64" + ] + }, + { + "description": "int2", + "type": "string", + "enum": [ + "int16" + ] + }, + { + "description": "int4", + "type": "string", + "enum": [ + "int32" + ] + }, + { + "description": "int8", + "type": "string", + "enum": [ + "int64" + ] + }, + { + "description": "numeric", + "type": "string", + "enum": [ + "bigDecimal" + ] + }, + { + "description": "timestamp", + "type": "string", + "enum": [ + "timestamp" + ] + }, + { + "description": "timestamp with timezone", + "type": "string", + "enum": [ + "timestamptz" + ] + }, + { + "description": "time", + "type": "string", + "enum": [ + "time" + ] + }, + { + "description": "time with timezone", + "type": "string", + "enum": [ + "timetz" + ] + }, + { + "description": "date", + "type": "string", + "enum": [ + "date" + ] + }, + { + "description": "uuid", + "type": "string", + "enum": [ + "uUID" + ] + }, + { + "description": "geography", + "type": "string", + "enum": [ + "geography" + ] + }, + { + "description": "geometry", + "type": "string", + "enum": [ + "geometry" + ] + }, { "description": "Any JSON number", "type": "string", diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap index e5160ba7c..0d02b139d 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap @@ -2301,15 +2301,15 @@ expression: default_configuration "spades" ] }, - "date": "string", - "even_number": "integer", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "even_number": "int32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "timestamp": "string", + "timestamp": "timestamp", "varchar": "string" } }, diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap index c19a98fd9..f061a0ce1 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap @@ -978,6 +978,104 @@ expression: generated_schema_json "string" ] }, + { + "description": "float4", + "type": "string", + "enum": [ + "float32" + ] + }, + { + "description": "float8", + "type": "string", + "enum": [ + "float64" + ] + }, + { + "description": "int2", + "type": "string", + "enum": [ + "int16" + ] + }, + { + "description": "int4", + "type": "string", + "enum": [ + "int32" + ] + }, + { + "description": "int8", + "type": "string", + "enum": [ + "int64" + ] + }, + { + "description": "numeric", + "type": "string", + "enum": [ + "bigDecimal" + ] + }, + { + "description": "timestamp", + "type": "string", + "enum": [ + "timestamp" + ] + }, + { + "description": "timestamp with timezone", + "type": "string", + "enum": [ + "timestamptz" + ] + }, + { + "description": "time", + "type": "string", + "enum": [ + "time" + ] + }, + { + "description": "time with timezone", + "type": "string", + "enum": [ + "timetz" + ] + }, + { + "description": "date", + "type": "string", + "enum": [ + "date" + ] + }, + { + "description": "uuid", + "type": "string", + "enum": [ + "uUID" + ] + }, + { + "description": "geography", + "type": "string", + "enum": [ + "geography" + ] + }, + { + "description": "geometry", + "type": "string", + "enum": [ + "geometry" + ] + }, { "description": "Any JSON number", "type": "string", 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 df4e7c728..0bd892909 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 @@ -690,7 +690,7 @@ expression: result }, "date": { "representation": { - "type": "string" + "type": "date" }, "aggregate_functions": { "max": { @@ -752,7 +752,7 @@ expression: result }, "even_number": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -880,7 +880,7 @@ expression: result }, "float4": { "representation": { - "type": "number" + "type": "float32" }, "aggregate_functions": { "avg": { @@ -990,7 +990,7 @@ expression: result }, "float8": { "representation": { - "type": "number" + "type": "float64" }, "aggregate_functions": { "avg": { @@ -1100,7 +1100,7 @@ expression: result }, "int2": { "representation": { - "type": "integer" + "type": "int16" }, "aggregate_functions": { "avg": { @@ -1228,7 +1228,7 @@ expression: result }, "int4": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -1356,7 +1356,7 @@ expression: result }, "int8": { "representation": { - "type": "integer" + "type": "int32" }, "aggregate_functions": { "avg": { @@ -1555,7 +1555,7 @@ expression: result }, "numeric": { "representation": { - "type": "number" + "type": "bigdecimal" }, "aggregate_functions": { "avg": { @@ -1899,7 +1899,7 @@ expression: result }, "timestamp": { "representation": { - "type": "string" + "type": "timestamp" }, "aggregate_functions": { "max": { @@ -1961,7 +1961,7 @@ expression: result }, "timestamptz": { "representation": { - "type": "string" + "type": "timestamptz" }, "aggregate_functions": { "max": { @@ -2085,7 +2085,7 @@ expression: result }, "uuid": { "representation": { - "type": "string" + "type": "uuid" }, "aggregate_functions": {}, "comparison_operators": { diff --git a/crates/tests/tests-common/Cargo.toml b/crates/tests/tests-common/Cargo.toml index 29a54e21a..ba176dba6 100644 --- a/crates/tests/tests-common/Cargo.toml +++ b/crates/tests/tests-common/Cargo.toml @@ -15,7 +15,7 @@ path = "src/lib.rs" ndc-postgres = { path = "../../connectors/ndc-postgres" } ndc-postgres-configuration = { path = "../../configuration" } -ndc-client = { workspace = true } +ndc-models = { workspace = true } ndc-sdk = { workspace = true } ndc-test = { workspace = true } diff --git a/crates/tests/tests-common/src/common_tests/ndc_tests.rs b/crates/tests/tests-common/src/common_tests/ndc_tests.rs index c430c5ca9..ecbfe915f 100644 --- a/crates/tests/tests-common/src/common_tests/ndc_tests.rs +++ b/crates/tests/tests-common/src/common_tests/ndc_tests.rs @@ -42,25 +42,26 @@ pub async fn test_connector(router: axum::Router) -> Result { } }); - let configuration = ndc_client::apis::configuration::Configuration { - base_path, - user_agent: None, - client: reqwest::Client::new(), - headers: Default::default(), - }; + // let configuration = ndc_models::apis::configuration::Configuration { + // base_path, + // user_agent: None, + // client: reqwest::Client::new(), + // headers: Default::default(), + // }; - let mut test_results = ndc_test::reporter::TestResults::default(); + let test_results = ndc_test::reporter::TestResults::default(); + + // ndc_test::test_connector( + // &ndc_test::configuration::TestConfiguration { + // seed: None, + // snapshots_dir: None, + // gen_config: Default::default(), + // }, + // &configuration, + // &mut test_results, + // ) + // .await; - ndc_test::test_connector( - &ndc_test::configuration::TestConfiguration { - seed: None, - snapshots_dir: None, - gen_config: Default::default(), - }, - &configuration, - &mut test_results, - ) - .await; if test_results.failures.is_empty() { Ok(()) } else { diff --git a/crates/tests/tests-common/src/request.rs b/crates/tests/tests-common/src/request.rs index f52e64628..acae8172c 100644 --- a/crates/tests/tests-common/src/request.rs +++ b/crates/tests/tests-common/src/request.rs @@ -2,7 +2,7 @@ pub use axum::http::StatusCode; pub use axum_test_helper::TestClient; -pub use ndc_client::models; +pub use ndc_sdk::models; use tokio::fs; /// Create a test client from a router. diff --git a/static/aurora/v3-chinook-ndc-metadata/configuration.json b/static/aurora/v3-chinook-ndc-metadata/configuration.json index 1fad813eb..99f2c35a3 100644 --- a/static/aurora/v3-chinook-ndc-metadata/configuration.json +++ b/static/aurora/v3-chinook-ndc-metadata/configuration.json @@ -2776,19 +2776,19 @@ "typeRepresentations": { "bool": "boolean", "char": "string", - "date": "string", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, diff --git a/static/citus/v3-chinook-ndc-metadata/configuration.json b/static/citus/v3-chinook-ndc-metadata/configuration.json index ab5668803..2aa450c17 100644 --- a/static/citus/v3-chinook-ndc-metadata/configuration.json +++ b/static/citus/v3-chinook-ndc-metadata/configuration.json @@ -3303,20 +3303,20 @@ "enum": ["hearts", "clubs", "diamonds", "spades"] }, "char": "string", - "date": "string", - "even_number": "integer", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "even_number": "int32", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, diff --git a/static/cockroach/v3-chinook-ndc-metadata/configuration.json b/static/cockroach/v3-chinook-ndc-metadata/configuration.json index 70c652e8e..1a7c9807e 100644 --- a/static/cockroach/v3-chinook-ndc-metadata/configuration.json +++ b/static/cockroach/v3-chinook-ndc-metadata/configuration.json @@ -2803,19 +2803,19 @@ "enum": ["hearts", "clubs", "diamonds", "spades"] }, "char": "string", - "date": "string", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, diff --git a/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json b/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json new file mode 100644 index 000000000..2167016c2 --- /dev/null +++ b/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json @@ -0,0 +1,3952 @@ +{ + "version": "3", + "$schema": "../../schema.json", + "connectionSettings": { + "connectionUri": { + "variable": "CONNECTION_URI" + }, + "poolSettings": { + "maxConnections": 50, + "poolTimeout": 30, + "idleTimeout": 180, + "connectionLifetime": 600 + }, + "isolationLevel": "ReadCommitted" + }, + "metadata": { + "tables": { + "Album": { + "schemaName": "public", + "tableName": "Album", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": "The identifier of an album" + }, + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": "The id of the artist that authored the album" + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": "The title of an album" + } + }, + "uniquenessConstraints": { + "PK_Album": ["AlbumId"] + }, + "foreignRelations": { + "FK_AlbumArtistId": { + "foreignSchema": "public", + "foreignTable": "Artist", + "columnMapping": { + "ArtistId": "ArtistId" + } + } + }, + "description": "The record of all albums" + }, + "Artist": { + "schemaName": "public", + "tableName": "Artist", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": "The identifier of an artist" + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": "The name of an artist" + } + }, + "uniquenessConstraints": { + "PK_Artist": ["ArtistId"] + }, + "foreignRelations": {}, + "description": "The record of all artists" + }, + "Customer": { + "schemaName": "public", + "tableName": "Customer", + "columns": { + "Address": { + "name": "Address", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "Company": { + "name": "Company", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": "The identifier of customer" + }, + "Email": { + "name": "Email", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": "The first name of a customer" + }, + "LastName": { + "name": "LastName", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": "The last name of a customer" + }, + "Phone": { + "name": "Phone", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "SupportRepId": { + "name": "SupportRepId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Customer": ["CustomerId"] + }, + "foreignRelations": { + "FK_CustomerSupportRepId": { + "foreignSchema": "public", + "foreignTable": "Employee", + "columnMapping": { + "SupportRepId": "EmployeeId" + } + } + }, + "description": "The record of all customers" + }, + "Employee": { + "schemaName": "public", + "tableName": "Employee", + "columns": { + "Address": { + "name": "Address", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "BirthDate": { + "name": "BirthDate", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "Email": { + "name": "Email", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "EmployeeId": { + "name": "EmployeeId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "HireDate": { + "name": "HireDate", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nullable", + "description": null + }, + "LastName": { + "name": "LastName", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "Phone": { + "name": "Phone", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "ReportsTo": { + "name": "ReportsTo", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Employee": ["EmployeeId"] + }, + "foreignRelations": { + "FK_EmployeeReportsTo": { + "foreignSchema": "public", + "foreignTable": "Employee", + "columnMapping": { + "ReportsTo": "EmployeeId" + } + } + }, + "description": null + }, + "Genre": { + "schemaName": "public", + "tableName": "Genre", + "columns": { + "GenreId": { + "name": "GenreId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Genre": ["GenreId"] + }, + "foreignRelations": {}, + "description": null + }, + "Invoice": { + "schemaName": "public", + "tableName": "Invoice", + "columns": { + "BillingAddress": { + "name": "BillingAddress", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "BillingCity": { + "name": "BillingCity", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "BillingCountry": { + "name": "BillingCountry", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "BillingPostalCode": { + "name": "BillingPostalCode", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "BillingState": { + "name": "BillingState", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceDate": { + "name": "InvoiceDate", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceId": { + "name": "InvoiceId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Total": { + "name": "Total", + "type": { + "scalarType": "numeric" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Invoice": ["InvoiceId"] + }, + "foreignRelations": { + "FK_InvoiceCustomerId": { + "foreignSchema": "public", + "foreignTable": "Customer", + "columnMapping": { + "CustomerId": "CustomerId" + } + } + }, + "description": null + }, + "InvoiceLine": { + "schemaName": "public", + "tableName": "InvoiceLine", + "columns": { + "InvoiceId": { + "name": "InvoiceId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceLineId": { + "name": "InvoiceLineId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Quantity": { + "name": "Quantity", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": { + "scalarType": "numeric" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_InvoiceLine": ["InvoiceLineId"] + }, + "foreignRelations": { + "FK_InvoiceLineInvoiceId": { + "foreignSchema": "public", + "foreignTable": "Invoice", + "columnMapping": { + "InvoiceId": "InvoiceId" + } + }, + "FK_InvoiceLineTrackId": { + "foreignSchema": "public", + "foreignTable": "Track", + "columnMapping": { + "TrackId": "TrackId" + } + } + }, + "description": null + }, + "MediaType": { + "schemaName": "public", + "tableName": "MediaType", + "columns": { + "MediaTypeId": { + "name": "MediaTypeId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_MediaType": ["MediaTypeId"] + }, + "foreignRelations": {}, + "description": null + }, + "Playlist": { + "schemaName": "public", + "tableName": "Playlist", + "columns": { + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "PlaylistId": { + "name": "PlaylistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Playlist": ["PlaylistId"] + }, + "foreignRelations": {}, + "description": null + }, + "PlaylistTrack": { + "schemaName": "public", + "tableName": "PlaylistTrack", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_PlaylistTrack": ["PlaylistId", "TrackId"] + }, + "foreignRelations": { + "FK_PlaylistTrackPlaylistId": { + "foreignSchema": "public", + "foreignTable": "Playlist", + "columnMapping": { + "PlaylistId": "PlaylistId" + } + }, + "FK_PlaylistTrackTrackId": { + "foreignSchema": "public", + "foreignTable": "Track", + "columnMapping": { + "TrackId": "TrackId" + } + } + }, + "description": null + }, + "Track": { + "schemaName": "public", + "tableName": "Track", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Bytes": { + "name": "Bytes", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Composer": { + "name": "Composer", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "GenreId": { + "name": "GenreId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "MediaTypeId": { + "name": "MediaTypeId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Milliseconds": { + "name": "Milliseconds", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": { + "scalarType": "numeric" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Track": ["TrackId"] + }, + "foreignRelations": { + "FK_TrackAlbumId": { + "foreignSchema": "public", + "foreignTable": "Album", + "columnMapping": { + "AlbumId": "AlbumId" + } + }, + "FK_TrackGenreId": { + "foreignSchema": "public", + "foreignTable": "Genre", + "columnMapping": { + "GenreId": "GenreId" + } + }, + "FK_TrackMediaTypeId": { + "foreignSchema": "public", + "foreignTable": "MediaType", + "columnMapping": { + "MediaTypeId": "MediaTypeId" + } + } + }, + "description": null + }, + "custom_dog": { + "schemaName": "custom", + "tableName": "dog", + "columns": { + "adopter_name": { + "name": "adopter_name", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + }, + "birthday": { + "name": "birthday", + "type": { + "scalarType": "date" + }, + "nullable": "nonNullable", + "hasDefault": "hasDefault", + "description": null + }, + "height_cm": { + "name": "height_cm", + "type": { + "scalarType": "numeric" + }, + "nullable": "nonNullable", + "description": null + }, + "height_in": { + "name": "height_in", + "type": { + "scalarType": "numeric" + }, + "nullable": "nullable", + "hasDefault": "hasDefault", + "isGenerated": "stored", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "isIdentity": "identityAlways", + "description": null + }, + "name": { + "name": "name", + "type": { + "scalarType": "text" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "dog_pkey": ["id"] + }, + "foreignRelations": {}, + "description": null + }, + "deck_of_cards": { + "schemaName": "public", + "tableName": "deck_of_cards", + "columns": { + "pips": { + "name": "pips", + "type": { + "scalarType": "int2" + }, + "nullable": "nonNullable", + "description": null + }, + "suit": { + "name": "suit", + "type": { + "scalarType": "card_suit" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "discoverable_types_root_occurrence": { + "schemaName": "public", + "tableName": "discoverable_types_root_occurrence", + "columns": { + "col": { + "name": "col", + "type": { + "compositeType": "discoverable_types" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "even_numbers": { + "schemaName": "public", + "tableName": "even_numbers", + "columns": { + "the_number": { + "name": "the_number", + "type": { + "scalarType": "even_number" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "phone_numbers": { + "schemaName": "public", + "tableName": "phone_numbers", + "columns": { + "the_number": { + "name": "the_number", + "type": { + "scalarType": "Phone" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "spatial_ref_sys": { + "schemaName": "public", + "tableName": "spatial_ref_sys", + "columns": { + "auth_name": { + "name": "auth_name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "auth_srid": { + "name": "auth_srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "proj4text": { + "name": "proj4text", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "srtext": { + "name": "srtext", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "spatial_ref_sys_pkey": ["srid"] + }, + "foreignRelations": {}, + "description": null + }, + "topology_layer": { + "schemaName": "topology", + "tableName": "layer", + "columns": { + "child_id": { + "name": "child_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "feature_column": { + "name": "feature_column", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "feature_type": { + "name": "feature_type", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "layer_id": { + "name": "layer_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "level": { + "name": "level", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "hasDefault": "hasDefault", + "description": null + }, + "schema_name": { + "name": "schema_name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "table_name": { + "name": "table_name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "topology_id": { + "name": "topology_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "layer_pkey": ["layer_id", "topology_id"], + "layer_schema_name_table_name_feature_column_key": [ + "feature_column", + "schema_name", + "table_name" + ] + }, + "foreignRelations": { + "layer_topology_id_fkey": { + "foreignSchema": "topology", + "foreignTable": "topology", + "columnMapping": { + "topology_id": "id" + } + } + }, + "description": null + }, + "topology_topology": { + "schemaName": "topology", + "tableName": "topology", + "columns": { + "hasz": { + "name": "hasz", + "type": { + "scalarType": "bool" + }, + "nullable": "nonNullable", + "hasDefault": "hasDefault", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "hasDefault": "hasDefault", + "description": null + }, + "name": { + "name": "name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "precision": { + "name": "precision", + "type": { + "scalarType": "float8" + }, + "nullable": "nonNullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "topology_name_key": ["name"], + "topology_pkey": ["id"] + }, + "foreignRelations": {}, + "description": null + } + }, + "compositeTypes": { + "committee": { + "name": "committee", + "fields": { + "members": { + "name": "members", + "type": { + "arrayType": { + "compositeType": "person_name" + } + }, + "description": null + }, + "name": { + "name": "name", + "type": { + "scalarType": "text" + }, + "description": null + } + }, + "description": null + }, + "discoverable_types": { + "name": "discoverable_types", + "fields": { + "only_occurring_here1": { + "name": "only_occurring_here1", + "type": { + "scalarType": "bit" + }, + "description": null + } + }, + "description": null + }, + "organization": { + "name": "organization", + "fields": { + "committees": { + "name": "committees", + "type": { + "arrayType": { + "compositeType": "committee" + } + }, + "description": null + }, + "name": { + "name": "name", + "type": { + "scalarType": "text" + }, + "description": null + } + }, + "description": null + }, + "person": { + "name": "person", + "fields": { + "address": { + "name": "address", + "type": { + "compositeType": "person_address" + }, + "description": null + }, + "name": { + "name": "name", + "type": { + "compositeType": "person_name" + }, + "description": null + } + }, + "description": null + }, + "person_address": { + "name": "person_address", + "fields": { + "address_line_1": { + "name": "address_line_1", + "type": { + "scalarType": "text" + }, + "description": "Address line No 1" + }, + "address_line_2": { + "name": "address_line_2", + "type": { + "scalarType": "text" + }, + "description": "Address line No 2" + } + }, + "description": "The address of a person, obviously" + }, + "person_name": { + "name": "person_name", + "fields": { + "first_name": { + "name": "first_name", + "type": { + "scalarType": "text" + }, + "description": "The first name of a person" + }, + "last_name": { + "name": "last_name", + "type": { + "scalarType": "text" + }, + "description": "The last name of a person" + } + }, + "description": "The name of a person, obviously" + } + }, + "nativeQueries": { + "address_identity_function": { + "sql": { + "inline": "SELECT {{address}} as result" + }, + "columns": { + "result": { + "name": "result", + "type": { + "compositeType": "person_address" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "address": { + "name": "address", + "type": { + "compositeType": "person_address" + }, + "nullable": "nullable", + "description": null + } + }, + "description": "A native query used to test support for composite types" + }, + "album_by_title": { + "sql": { + "inline": "SELECT * FROM public.\"Album\" WHERE \"Title\" LIKE {{title}} AND \"AlbumId\" < {{id}}" + }, + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "array_reverse": { + "sql": { + "inline": "SELECT array_agg(t.x) as reversed FROM (SELECT x FROM unnest({{array}}) WITH ORDINALITY AS t(x,ix) ORDER BY t.ix DESC) as t(x)" + }, + "columns": { + "reversed": { + "name": "reversed", + "type": { + "arrayType": { + "scalarType": "varchar" + } + }, + "nullable": "nullable", + "description": "The reversed array" + } + }, + "arguments": { + "array": { + "name": "array", + "type": { + "arrayType": { + "scalarType": "varchar" + } + }, + "nullable": "nonNullable", + "description": "The array to reverse. This is necessarily of a monomorphic type." + } + }, + "description": "A native query used to test support for arrays as inputs" + }, + "array_series": { + "sql": { + "inline": "SELECT 3 as three, array_agg(arr.series) AS series FROM (SELECT generate_series({{from}},{{to}}) AS series) AS arr" + }, + "columns": { + "series": { + "name": "series", + "type": { + "arrayType": { + "scalarType": "int4" + } + }, + "nullable": "nullable", + "description": null + }, + "three": { + "name": "three", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "from": { + "name": "from", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "to": { + "name": "to", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "description": "A native query used to test support for arrays" + }, + "artist": { + "sql": { + "inline": "SELECT * FROM public.\"Artist\"" + }, + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": {}, + "description": null + }, + "artist_below_id": { + "sql": { + "inline": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}" + }, + "columns": { + "id": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "count_elements": { + "sql": { + "inline": "SELECT array_length({{array_argument}}, 1) as result" + }, + "columns": { + "result": { + "name": "result", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "array_argument": { + "name": "array_argument", + "type": { + "arrayType": { + "scalarType": "text" + } + }, + "nullable": "nullable", + "description": null + } + }, + "description": "A native query used to test support array-valued variables" + }, + "delete_playlist_track": { + "sql": { + "inline": "DELETE FROM public.\"PlaylistTrack\" WHERE \"TrackId\" = {{track_id}} RETURNING *" + }, + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "track_id": { + "name": "track_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null, + "isProcedure": true + }, + "insert_album": { + "sql": { + "inline": "INSERT INTO public.\"Album\" VALUES({{id}}, {{title}}, {{artist_id}}) RETURNING *" + }, + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "artist_id": { + "name": "artist_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null, + "isProcedure": true + }, + "insert_artist": { + "sql": { + "inline": "INSERT INTO public.\"Artist\" VALUES ({{id}}, {{name}}) RETURNING *" + }, + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null, + "isProcedure": true + }, + "make_person": { + "sql": { + "inline": "SELECT ROW({{name}}, {{address}})::person as result" + }, + "columns": { + "result": { + "name": "result", + "type": { + "compositeType": "person" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "address": { + "name": "address", + "type": { + "compositeType": "person_address" + }, + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": { + "compositeType": "person_name" + }, + "nullable": "nullable", + "description": null + } + }, + "description": "A native query used to test support for composite types" + }, + "summarize_organizations": { + "sql": { + "file": "./native_queries/summarize_organizations.sql" + }, + "columns": { + "result": { + "name": "result", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "organizations": { + "name": "organizations", + "type": { + "arrayType": { + "compositeType": "organization" + } + }, + "nullable": "nullable", + "description": null + } + }, + "description": "A native query used to test support array-valued variables" + }, + "value_types": { + "sql": { + "inline": "SELECT {{bool}} as bool, {{int4}} as int4, {{int2}} as int2, {{int8}} as int8, {{float4}} as float4, {{float8}} as \"float8\", {{numeric}} as numeric, {{char}} as char, {{varchar}} as \"varchar\", {{text}} as text, {{date}} as date, {{time}} as time, {{timetz}} as timetz, {{timestamp}} as timestamp, {{timestamptz}} as timestamptz, {{uuid}} as uuid" + }, + "columns": { + "bool": { + "name": "bool", + "type": { + "scalarType": "bool" + }, + "nullable": "nullable", + "description": null + }, + "char": { + "name": "char", + "type": { + "scalarType": "char" + }, + "nullable": "nullable", + "description": null + }, + "date": { + "name": "date", + "type": { + "scalarType": "date" + }, + "nullable": "nullable", + "description": null + }, + "float4": { + "name": "float4", + "type": { + "scalarType": "float4" + }, + "nullable": "nullable", + "description": null + }, + "float8": { + "name": "float8", + "type": { + "scalarType": "float8" + }, + "nullable": "nullable", + "description": null + }, + "int2": { + "name": "int2", + "type": { + "scalarType": "int2" + }, + "nullable": "nullable", + "description": null + }, + "int4": { + "name": "int4", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "int8": { + "name": "int8", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "numeric": { + "name": "numeric", + "type": { + "scalarType": "numeric" + }, + "nullable": "nullable", + "description": null + }, + "text": { + "name": "text", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + }, + "time": { + "name": "time", + "type": { + "scalarType": "time" + }, + "nullable": "nullable", + "description": null + }, + "timestamp": { + "name": "timestamp", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nullable", + "description": null + }, + "timestamptz": { + "name": "timestamptz", + "type": { + "scalarType": "timestamptz" + }, + "nullable": "nullable", + "description": null + }, + "timetz": { + "name": "timetz", + "type": { + "scalarType": "timetz" + }, + "nullable": "nullable", + "description": null + }, + "uuid": { + "name": "uuid", + "type": { + "scalarType": "uuid" + }, + "nullable": "nullable", + "description": null + }, + "varchar": { + "name": "varchar", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "bool": { + "name": "bool", + "type": { + "scalarType": "bool" + }, + "nullable": "nullable", + "description": null + }, + "char": { + "name": "char", + "type": { + "scalarType": "char" + }, + "nullable": "nullable", + "description": null + }, + "date": { + "name": "date", + "type": { + "scalarType": "date" + }, + "nullable": "nullable", + "description": null + }, + "float4": { + "name": "float4", + "type": { + "scalarType": "float4" + }, + "nullable": "nullable", + "description": null + }, + "float8": { + "name": "float8", + "type": { + "scalarType": "float8" + }, + "nullable": "nullable", + "description": null + }, + "int2": { + "name": "int2", + "type": { + "scalarType": "int2" + }, + "nullable": "nullable", + "description": null + }, + "int4": { + "name": "int4", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "int8": { + "name": "int8", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "numeric": { + "name": "numeric", + "type": { + "scalarType": "numeric" + }, + "nullable": "nullable", + "description": null + }, + "text": { + "name": "text", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + }, + "time": { + "name": "time", + "type": { + "scalarType": "time" + }, + "nullable": "nullable", + "description": null + }, + "timestamp": { + "name": "timestamp", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nullable", + "description": null + }, + "timestamptz": { + "name": "timestamptz", + "type": { + "scalarType": "timestamptz" + }, + "nullable": "nullable", + "description": null + }, + "timetz": { + "name": "timetz", + "type": { + "scalarType": "timetz" + }, + "nullable": "nullable", + "description": null + }, + "uuid": { + "name": "uuid", + "type": { + "scalarType": "uuid" + }, + "nullable": "nullable", + "description": null + }, + "varchar": { + "name": "varchar", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "description": null + } + }, + "aggregateFunctions": { + "Phone": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, + "bit": { + "bit_and": { + "returnType": "bit" + }, + "bit_or": { + "returnType": "bit" + }, + "bit_xor": { + "returnType": "bit" + } + }, + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "bpchar": { + "max": { + "returnType": "bpchar" + }, + "min": { + "returnType": "bpchar" + } + }, + "card_suit": { + "max": { + "returnType": "card_suit" + }, + "min": { + "returnType": "card_suit" + } + }, + "char": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "even_number": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "bit_xor": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "float4": { + "avg": { + "returnType": "float8" + }, + "max": { + "returnType": "float4" + }, + "min": { + "returnType": "float4" + }, + "stddev": { + "returnType": "float8" + }, + "stddev_pop": { + "returnType": "float8" + }, + "stddev_samp": { + "returnType": "float8" + }, + "sum": { + "returnType": "float4" + }, + "var_pop": { + "returnType": "float8" + }, + "var_samp": { + "returnType": "float8" + }, + "variance": { + "returnType": "float8" + } + }, + "float8": { + "avg": { + "returnType": "float8" + }, + "max": { + "returnType": "float8" + }, + "min": { + "returnType": "float8" + }, + "stddev": { + "returnType": "float8" + }, + "stddev_pop": { + "returnType": "float8" + }, + "stddev_samp": { + "returnType": "float8" + }, + "sum": { + "returnType": "float8" + }, + "var_pop": { + "returnType": "float8" + }, + "var_samp": { + "returnType": "float8" + }, + "variance": { + "returnType": "float8" + } + }, + "int2": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int2" + }, + "bit_or": { + "returnType": "int2" + }, + "bit_xor": { + "returnType": "int2" + }, + "max": { + "returnType": "int2" + }, + "min": { + "returnType": "int2" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "int4": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int4" + }, + "bit_or": { + "returnType": "int4" + }, + "bit_xor": { + "returnType": "int4" + }, + "max": { + "returnType": "int4" + }, + "min": { + "returnType": "int4" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "int8": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int8" + }, + "bit_or": { + "returnType": "int8" + }, + "bit_xor": { + "returnType": "int8" + }, + "max": { + "returnType": "int8" + }, + "min": { + "returnType": "int8" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "numeric" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "interval": { + "avg": { + "returnType": "interval" + }, + "max": { + "returnType": "interval" + }, + "min": { + "returnType": "interval" + }, + "sum": { + "returnType": "interval" + } + }, + "numeric": { + "avg": { + "returnType": "numeric" + }, + "max": { + "returnType": "numeric" + }, + "min": { + "returnType": "numeric" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "numeric" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "text": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + }, + "time": { + "avg": { + "returnType": "interval" + }, + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + }, + "sum": { + "returnType": "interval" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + }, + "varchar": { + "max": { + "returnType": "text" + }, + "min": { + "returnType": "text" + } + } + }, + "comparisonOperators": { + "Phone": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "Phone", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "Phone", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "Phone", + "isInfix": false + } + }, + "bit": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bit", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bit", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bit", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bit", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bit", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bit", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bit", + "isInfix": true + } + }, + "bool": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bool", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bool", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bool", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bool", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bool", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bool", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bool", + "isInfix": true + } + }, + "bpchar": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "bpchar", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "bpchar", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "bpchar", + "isInfix": false + } + }, + "card_suit": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "card_suit", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "card_suit", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "card_suit", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "card_suit", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "card_suit", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "card_suit", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "card_suit", + "isInfix": true + } + }, + "char": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "char", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "char", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "char", + "isInfix": false + } + }, + "date": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "date", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "date", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "date", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "date", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "date", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "date", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "date", + "isInfix": true + } + }, + "even_number": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "even_number", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "even_number", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "even_number", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "even_number", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "even_number", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "even_number", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "even_number", + "isInfix": true + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "float4", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "float4", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "float4", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "float4", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "float4", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "float4", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "float4", + "isInfix": true + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "float8", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "float8", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "float8", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "float8", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "float8", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "float8", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "float8", + "isInfix": true + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "int2", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "int2", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "int2", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "int2", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "int2", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "int2", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "int2", + "isInfix": true + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "int4", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "int4", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "int4", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "int4", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "int4", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "int4", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "int4", + "isInfix": true + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "int8", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "int8", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "int8", + "isInfix": true + } + }, + "interval": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "interval", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "interval", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "interval", + "isInfix": true + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "numeric", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "numeric", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "numeric", + "isInfix": true + } + }, + "text": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "text", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "text", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "text", + "isInfix": false + } + }, + "time": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "time", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "time", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "time", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "time", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "time", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "time", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "time", + "isInfix": true + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "timestamp", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "timestamp", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "timestamp", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "timestamp", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "timestamp", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "timestamp", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "timestamp", + "isInfix": true + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "timestamptz", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "timestamptz", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "timestamptz", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "timestamptz", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "timestamptz", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "timestamptz", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "timestamptz", + "isInfix": true + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "timetz", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "timetz", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "timetz", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "timetz", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "timetz", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "timetz", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "timetz", + "isInfix": true + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "uuid", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "uuid", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "uuid", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "uuid", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "uuid", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "uuid", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "uuid", + "isInfix": true + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "operatorKind": "equal", + "argumentType": "varchar", + "isInfix": true + }, + "_gt": { + "operatorName": ">", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_gte": { + "operatorName": ">=", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_ilike": { + "operatorName": "~~*", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_in": { + "operatorName": "IN", + "operatorKind": "in", + "argumentType": "varchar", + "isInfix": true + }, + "_iregex": { + "operatorName": "~*", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_like": { + "operatorName": "~~", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_lt": { + "operatorName": "<", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_lte": { + "operatorName": "<=", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_neq": { + "operatorName": "<>", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_nilike": { + "operatorName": "!~~*", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_niregex": { + "operatorName": "!~*", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_nlike": { + "operatorName": "!~~", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_nregex": { + "operatorName": "!~", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "_regex": { + "operatorName": "~", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": true + }, + "st_coveredby": { + "operatorName": "st_coveredby", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + }, + "st_covers": { + "operatorName": "st_covers", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + }, + "st_intersects": { + "operatorName": "st_intersects", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + }, + "st_relatematch": { + "operatorName": "st_relatematch", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + }, + "starts_with": { + "operatorName": "starts_with", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + }, + "ts_match_tt": { + "operatorName": "ts_match_tt", + "operatorKind": "custom", + "argumentType": "varchar", + "isInfix": false + } + } + }, + "typeRepresentations": { + "Phone": "string", + "bit": "string", + "bool": "boolean", + "bpchar": "string", + "card_suit": { + "enum": ["hearts", "clubs", "diamonds", "spades"] + }, + "char": "string", + "date": "string", + "even_number": "integer", + "float4": "number", + "float8": "number", + "int2": "integer", + "int4": "integer", + "int8": "integer", + "numeric": "number", + "text": "string", + "time": "string", + "timestamp": "string", + "timestamptz": "string", + "timetz": "string", + "uuid": "string", + "varchar": "string" + } + }, + "introspectionOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemasForTables": ["public"], + "unqualifiedSchemasForTypesAndProcedures": [ + "public", + "pg_catalog", + "tiger" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq", + "operatorKind": "equal" + }, + { + "operatorName": "<=", + "exposedName": "_lte", + "operatorKind": "custom" + }, + { + "operatorName": ">", + "exposedName": "_gt", + "operatorKind": "custom" + }, + { + "operatorName": ">=", + "exposedName": "_gte", + "operatorKind": "custom" + }, + { + "operatorName": "<", + "exposedName": "_lt", + "operatorKind": "custom" + }, + { + "operatorName": "!=", + "exposedName": "_neq", + "operatorKind": "custom" + }, + { + "operatorName": "LIKE", + "exposedName": "_like", + "operatorKind": "custom" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike", + "operatorKind": "custom" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike", + "operatorKind": "custom" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike", + "operatorKind": "custom" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar", + "operatorKind": "custom" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar", + "operatorKind": "custom" + }, + { + "operatorName": "<>", + "exposedName": "_neq", + "operatorKind": "custom" + }, + { + "operatorName": "~~", + "exposedName": "_like", + "operatorKind": "custom" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike", + "operatorKind": "custom" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike", + "operatorKind": "custom" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike", + "operatorKind": "custom" + }, + { + "operatorName": "~", + "exposedName": "_regex", + "operatorKind": "custom" + }, + { + "operatorName": "!~", + "exposedName": "_nregex", + "operatorKind": "custom" + }, + { + "operatorName": "~*", + "exposedName": "_iregex", + "operatorKind": "custom" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex", + "operatorKind": "custom" + } + ], + "introspectPrefixFunctionComparisonOperators": [ + "box_above", + "box_below", + "box_contain", + "box_contain_pt", + "box_contained", + "box_left", + "box_overabove", + "box_overbelow", + "box_overlap", + "box_overleft", + "box_overright", + "box_right", + "box_same", + "circle_above", + "circle_below", + "circle_contain", + "circle_contain_pt", + "circle_contained", + "circle_left", + "circle_overabove", + "circle_overbelow", + "circle_overlap", + "circle_overleft", + "circle_overright", + "circle_right", + "circle_same", + "contains_2d", + "equals", + "geography_overlaps", + "geometry_above", + "geometry_below", + "geometry_contained_3d", + "geometry_contains", + "geometry_contains_3d", + "geometry_contains_nd", + "geometry_left", + "geometry_overabove", + "geometry_overbelow", + "geometry_overlaps", + "geometry_overlaps_3d", + "geometry_overlaps_nd", + "geometry_overleft", + "geometry_overright", + "geometry_right", + "geometry_same", + "geometry_same_3d", + "geometry_same_nd", + "geometry_within", + "geometry_within_nd", + "inet_same_family", + "inter_lb", + "inter_sb", + "inter_sl", + "is_contained_2d", + "ishorizontal", + "isparallel", + "isperp", + "isvertical", + "jsonb_contained", + "jsonb_contains", + "jsonb_exists", + "jsonb_path_exists_opr", + "jsonb_path_match_opr", + "line_intersect", + "line_parallel", + "line_perp", + "lseg_intersect", + "lseg_parallel", + "lseg_perp", + "network_overlap", + "network_sub", + "network_sup", + "on_pb", + "on_pl", + "on_ppath", + "on_ps", + "on_sb", + "on_sl", + "overlaps_2d", + "path_contain_pt", + "path_inter", + "point_above", + "point_below", + "point_horiz", + "point_left", + "point_right", + "point_vert", + "poly_above", + "poly_below", + "poly_contain", + "poly_contain_pt", + "poly_contained", + "poly_left", + "poly_overabove", + "poly_overbelow", + "poly_overlap", + "poly_overleft", + "poly_overright", + "poly_right", + "poly_same", + "pt_contained_poly", + "st_3dintersects", + "st_contains", + "st_containsproperly", + "st_coveredby", + "st_covers", + "st_crosses", + "st_disjoint", + "st_equals", + "st_intersects", + "st_isvalid", + "st_orderingequals", + "st_overlaps", + "st_relatematch", + "st_touches", + "st_within", + "starts_with", + "ts_match_qv", + "ts_match_tq", + "ts_match_tt", + "ts_match_vq", + "tsq_mcontained", + "tsq_mcontains", + "xmlexists", + "xmlvalidate", + "xpath_exists" + ] + }, + "mutationsVersion": "veryExperimentalWip" +} diff --git a/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql b/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql new file mode 100644 index 000000000..58c5e163d --- /dev/null +++ b/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql @@ -0,0 +1,22 @@ +SELECT + 'The organization ' || org.name || ' has ' || no_committees :: text || ' committees, ' || 'the largest of which has ' || max_members || ' members.' AS result +FROM + ( + SELECT + orgs.* + FROM + unnest({{organizations}}) AS orgs + ) AS org + JOIN LATERAL ( + SELECT + count(committee.*) AS no_committees, + max(members_agg.no_members) AS max_members + FROM + unnest(org.committees) AS committee + JOIN LATERAL ( + SELECT + count(*) AS no_members + FROM + unnest(committee.members) AS members + ) AS members_agg ON TRUE + ) AS coms ON TRUE diff --git a/static/postgres/broken-queries-ndc-metadata/configuration.json b/static/postgres/broken-queries-ndc-metadata/configuration.json index af1cf48d8..cbb9f44f1 100644 --- a/static/postgres/broken-queries-ndc-metadata/configuration.json +++ b/static/postgres/broken-queries-ndc-metadata/configuration.json @@ -299,9 +299,9 @@ } }, "typeRepresentations": { - "int4": "integer", - "int8": "integer", - "numeric": "number" + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal" } }, "introspectionOptions": { diff --git a/static/postgres/v3-chinook-ndc-metadata/configuration.json b/static/postgres/v3-chinook-ndc-metadata/configuration.json index 2167016c2..7e2d2a086 100644 --- a/static/postgres/v3-chinook-ndc-metadata/configuration.json +++ b/static/postgres/v3-chinook-ndc-metadata/configuration.json @@ -3680,20 +3680,20 @@ "enum": ["hearts", "clubs", "diamonds", "spades"] }, "char": "string", - "date": "string", - "even_number": "integer", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "even_number": "int32", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, diff --git a/static/schema.json b/static/schema.json index 4ff01b328..fc70f0f5b 100644 --- a/static/schema.json +++ b/static/schema.json @@ -890,6 +890,76 @@ "type": "string", "enum": ["string"] }, + { + "description": "float4", + "type": "string", + "enum": ["float32"] + }, + { + "description": "float8", + "type": "string", + "enum": ["float64"] + }, + { + "description": "int2", + "type": "string", + "enum": ["int16"] + }, + { + "description": "int4", + "type": "string", + "enum": ["int32"] + }, + { + "description": "int8", + "type": "string", + "enum": ["int64"] + }, + { + "description": "numeric", + "type": "string", + "enum": ["bigDecimal"] + }, + { + "description": "timestamp", + "type": "string", + "enum": ["timestamp"] + }, + { + "description": "timestamp with timezone", + "type": "string", + "enum": ["timestamptz"] + }, + { + "description": "time", + "type": "string", + "enum": ["time"] + }, + { + "description": "time with timezone", + "type": "string", + "enum": ["timetz"] + }, + { + "description": "date", + "type": "string", + "enum": ["date"] + }, + { + "description": "uuid", + "type": "string", + "enum": ["uUID"] + }, + { + "description": "geography", + "type": "string", + "enum": ["geography"] + }, + { + "description": "geometry", + "type": "string", + "enum": ["geometry"] + }, { "description": "Any JSON number", "type": "string", diff --git a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json index ea3a530f1..a6dc346a9 100644 --- a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json +++ b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json @@ -3262,20 +3262,20 @@ "enum": ["hearts", "clubs", "diamonds", "spades"] }, "char": "string", - "date": "string", - "even_number": "integer", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "even_number": "int32", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "int64", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, From 6928aed674f1eb957cd2b5d578fc42071388efb9 Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Fri, 5 Apr 2024 16:25:06 +0300 Subject: [PATCH 2/6] fix ndc_test --- .../ndc-postgres/src/capabilities.rs | 2 +- ..._capabilities_tests__get_capabilities.snap | 2 +- .../src/common_tests/ndc_tests.rs | 33 +++++++++---------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/crates/connectors/ndc-postgres/src/capabilities.rs b/crates/connectors/ndc-postgres/src/capabilities.rs index 0b3656ee1..ee72b96b7 100644 --- a/crates/connectors/ndc-postgres/src/capabilities.rs +++ b/crates/connectors/ndc-postgres/src/capabilities.rs @@ -8,7 +8,7 @@ use ndc_sdk::models; /// from the NDC specification. pub fn get_capabilities() -> models::CapabilitiesResponse { models::CapabilitiesResponse { - version: "0.1.1".into(), + version: "0.1.2".into(), capabilities: models::Capabilities { query: models::QueryCapabilities { aggregates: Some(models::LeafCapability {}), diff --git a/crates/tests/databases-tests/src/snapshots/databases_tests__capabilities_tests__get_capabilities.snap b/crates/tests/databases-tests/src/snapshots/databases_tests__capabilities_tests__get_capabilities.snap index c292f0a96..57ac78c5d 100644 --- a/crates/tests/databases-tests/src/snapshots/databases_tests__capabilities_tests__get_capabilities.snap +++ b/crates/tests/databases-tests/src/snapshots/databases_tests__capabilities_tests__get_capabilities.snap @@ -3,7 +3,7 @@ source: crates/tests/databases-tests/src/capabilities_tests.rs expression: "ndc_postgres::capabilities::get_capabilities()" --- { - "version": "0.1.1", + "version": "0.1.2", "capabilities": { "query": { "aggregates": {}, diff --git a/crates/tests/tests-common/src/common_tests/ndc_tests.rs b/crates/tests/tests-common/src/common_tests/ndc_tests.rs index ecbfe915f..dc5d77e9f 100644 --- a/crates/tests/tests-common/src/common_tests/ndc_tests.rs +++ b/crates/tests/tests-common/src/common_tests/ndc_tests.rs @@ -42,26 +42,23 @@ pub async fn test_connector(router: axum::Router) -> Result { } }); - // let configuration = ndc_models::apis::configuration::Configuration { - // base_path, - // user_agent: None, - // client: reqwest::Client::new(), - // headers: Default::default(), - // }; + let configuration = ndc_test::client::Configuration { + base_path, + client: reqwest::Client::new(), + }; - let test_results = ndc_test::reporter::TestResults::default(); - - // ndc_test::test_connector( - // &ndc_test::configuration::TestConfiguration { - // seed: None, - // snapshots_dir: None, - // gen_config: Default::default(), - // }, - // &configuration, - // &mut test_results, - // ) - // .await; + let mut test_results = ndc_test::reporter::TestResults::default(); + ndc_test::test_connector( + &ndc_test::configuration::TestConfiguration { + seed: None, + snapshots_dir: None, + gen_config: Default::default(), + }, + &configuration, + &mut test_results, + ) + .await; if test_results.failures.is_empty() { Ok(()) } else { From a698642bd30eb5531457ad19973556e9af9e2f1d Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Fri, 5 Apr 2024 16:27:38 +0300 Subject: [PATCH 3/6] comments --- crates/connectors/ndc-postgres/src/schema.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/connectors/ndc-postgres/src/schema.rs b/crates/connectors/ndc-postgres/src/schema.rs index c09fa6401..7bdf1ee92 100644 --- a/crates/connectors/ndc-postgres/src/schema.rs +++ b/crates/connectors/ndc-postgres/src/schema.rs @@ -615,12 +615,15 @@ fn make_procedure_type( } } +/// Map our local type representation to ndc-spec type representation. fn map_type_representation( type_representation: &metadata::TypeRepresentation, ) -> models::TypeRepresentation { match type_representation { + // Stop gap until we remove these. Done so we won't break compatability. metadata::TypeRepresentation::Integer => models::TypeRepresentation::Int32, metadata::TypeRepresentation::Number => models::TypeRepresentation::Float64, + metadata::TypeRepresentation::Boolean => models::TypeRepresentation::Boolean, metadata::TypeRepresentation::String => models::TypeRepresentation::String, metadata::TypeRepresentation::Float32 => models::TypeRepresentation::Float32, From 670a92dbcb66f33c83a11cdc3b5fab49615db43d Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Fri, 5 Apr 2024 16:29:32 +0300 Subject: [PATCH 4/6] changelog --- changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 7b4cc1668..d71c2f8a8 100644 --- a/changelog.md +++ b/changelog.md @@ -5,12 +5,15 @@ ### Added - Expose the type representation of base types and domain types. - ([#398](https://github.com/hasura/ndc-postgres/pull/397)) + ([#398](https://github.com/hasura/ndc-postgres/pull/398)) - Expose the type representation of enums via the ndc schema. ([#397](https://github.com/hasura/ndc-postgres/pull/397)) ### Changed +- Support ndc-spec v0.1.2 and change the type representation of types accordingly. + ([#408](https://github.com/hasura/ndc-postgres/pull/408)) + ### Fixed - Fix schema conflict result_type for native query mutations. From 36037329c08240fdf60d554fbc14ef0fc234f31b Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Fri, 5 Apr 2024 16:30:30 +0300 Subject: [PATCH 5/6] machete --- Cargo.lock | 1 - crates/tests/tests-common/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1441875d7..a0085aebe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3060,7 +3060,6 @@ dependencies = [ "env_logger", "hyper", "jsonschema", - "ndc-models", "ndc-postgres", "ndc-postgres-configuration", "ndc-sdk", diff --git a/crates/tests/tests-common/Cargo.toml b/crates/tests/tests-common/Cargo.toml index ba176dba6..9714e64c2 100644 --- a/crates/tests/tests-common/Cargo.toml +++ b/crates/tests/tests-common/Cargo.toml @@ -15,7 +15,6 @@ path = "src/lib.rs" ndc-postgres = { path = "../../connectors/ndc-postgres" } ndc-postgres-configuration = { path = "../../configuration" } -ndc-models = { workspace = true } ndc-sdk = { workspace = true } ndc-test = { workspace = true } From 8db2336ee1c39574a52f093fc5eaab0e22ca01c1 Mon Sep 17 00:00:00 2001 From: Gil Mizrahi Date: Mon, 8 Apr 2024 12:53:52 +0300 Subject: [PATCH 6/6] update --- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/configuration/src/version3/mod.rs | 17 ++++------- crates/connectors/ndc-postgres/src/schema.rs | 13 ++++----- .../metadata/src/metadata/database.rs | 2 ++ ...schema_tests__schema_test__get_schema.snap | 2 +- ...schema_tests__schema_test__get_schema.snap | 2 +- ...ation_tests__get_configuration_schema.snap | 7 +++++ ...tests__get_rawconfiguration_v3_schema.snap | 7 +++++ ...v3_initial_configuration_is_unchanged.snap | 2 +- ..._openapi__up_to_date_generated_schema.snap | 7 +++++ ...schema_tests__schema_test__get_schema.snap | 2 +- .../configuration.json | 2 +- .../configuration.json | 2 +- .../configuration.json | 2 +- .../configuration.json | 28 +++++++++---------- .../summarize_organizations.sql | 0 .../configuration.json | 2 +- .../configuration.json | 2 +- static/schema.json | 5 ++++ .../configuration.json | 2 +- 21 files changed, 64 insertions(+), 46 deletions(-) rename static/ndc-metadata-snapshots/{87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942 => 36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25}/configuration.json (99%) rename static/ndc-metadata-snapshots/{87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942 => 36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25}/native_queries/summarize_organizations.sql (100%) diff --git a/Cargo.lock b/Cargo.lock index a0085aebe..b6d6ccd12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1494,7 +1494,7 @@ dependencies = [ [[package]] name = "ndc-sdk" version = "0.1.0" -source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=caed508bd97ed6d733d5b6c45c91349315379db1#caed508bd97ed6d733d5b6c45c91349315379db1" +source = "git+https://github.com/hasura/ndc-sdk-rs.git?rev=7409334#7409334d2ec2ca1d05fb341e69c9f07af520d8e0" dependencies = [ "async-trait", "axum", diff --git a/Cargo.toml b/Cargo.toml index c64284fc3..5c1d61930 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,5 +48,5 @@ unused_async = "allow" [workspace.dependencies] ndc-models = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } -ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "caed508bd97ed6d733d5b6c45c91349315379db1" } +ndc-sdk = { git = "https://github.com/hasura/ndc-sdk-rs.git", rev = "7409334" } ndc-test = { git = "https://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } diff --git a/crates/configuration/src/version3/mod.rs b/crates/configuration/src/version3/mod.rs index 5a90bf57d..c2f04c167 100644 --- a/crates/configuration/src/version3/mod.rs +++ b/crates/configuration/src/version3/mod.rs @@ -228,17 +228,6 @@ fn base_type_representations() -> database::TypeRepresentations { database::ScalarType("float4".to_string()), database::TypeRepresentation::Float32, ), - // Note that we default wide numerical types to Number/Integer because any column of such type - // that PostgreSQL outputs as json will still be using numbers, and there is nothing we can - // feasibly do about this that doesn't involve very careful book-keeping on types and extra - // deserialization/serialization passes over query results. - // - // Hinting any such type as String would thus only affect input. It is therefore up to users - // themselves to opt in to such assymetrical behavior if they can benefit from that. But - // nothing saves anyone from having to use a big-numbers aware json parser if they are ever - // going to consume the results of queries that use such types. - // - // See for instance https://neon.tech/blog/parsing-json-from-postgres-in-js. ( database::ScalarType("float8".to_string()), database::TypeRepresentation::Float64, @@ -253,7 +242,11 @@ fn base_type_representations() -> database::TypeRepresentations { ), ( database::ScalarType("int8".to_string()), - database::TypeRepresentation::Int64, + // ndc-spec defines that Int64 has the json representation of a string. + // This is not what we do now and is a breaking change. + // This will need to be changed in the future. In the meantime, we report + // The type representation to be json. + database::TypeRepresentation::Json, ), ( database::ScalarType("numeric".to_string()), diff --git a/crates/connectors/ndc-postgres/src/schema.rs b/crates/connectors/ndc-postgres/src/schema.rs index 7bdf1ee92..0388c40b3 100644 --- a/crates/connectors/ndc-postgres/src/schema.rs +++ b/crates/connectors/ndc-postgres/src/schema.rs @@ -620,20 +620,13 @@ fn map_type_representation( type_representation: &metadata::TypeRepresentation, ) -> models::TypeRepresentation { match type_representation { - // Stop gap until we remove these. Done so we won't break compatability. - metadata::TypeRepresentation::Integer => models::TypeRepresentation::Int32, - metadata::TypeRepresentation::Number => models::TypeRepresentation::Float64, - metadata::TypeRepresentation::Boolean => models::TypeRepresentation::Boolean, metadata::TypeRepresentation::String => models::TypeRepresentation::String, metadata::TypeRepresentation::Float32 => models::TypeRepresentation::Float32, metadata::TypeRepresentation::Float64 => models::TypeRepresentation::Float64, metadata::TypeRepresentation::Int16 => models::TypeRepresentation::Int16, metadata::TypeRepresentation::Int32 => models::TypeRepresentation::Int32, - // ndc-spec defines that Int64 has the json representation of a string. - // This is not what we do now and is a breaking change. - // This will need to be changed in the future. - metadata::TypeRepresentation::Int64 => models::TypeRepresentation::Int32, + metadata::TypeRepresentation::Int64 => models::TypeRepresentation::Int64, metadata::TypeRepresentation::BigDecimal => models::TypeRepresentation::BigDecimal, metadata::TypeRepresentation::Timestamp => models::TypeRepresentation::Timestamp, metadata::TypeRepresentation::Timestamptz => models::TypeRepresentation::TimestampTZ, @@ -643,8 +636,12 @@ fn map_type_representation( metadata::TypeRepresentation::Geometry => models::TypeRepresentation::Geometry, metadata::TypeRepresentation::Geography => models::TypeRepresentation::Geography, metadata::TypeRepresentation::UUID => models::TypeRepresentation::UUID, + metadata::TypeRepresentation::Json => models::TypeRepresentation::JSON, metadata::TypeRepresentation::Enum(variants) => models::TypeRepresentation::Enum { one_of: variants.clone(), }, + // Stop gap until we remove these. Done so we won't break compatability. + metadata::TypeRepresentation::Integer => models::TypeRepresentation::JSON, + metadata::TypeRepresentation::Number => models::TypeRepresentation::JSON, } } diff --git a/crates/query-engine/metadata/src/metadata/database.rs b/crates/query-engine/metadata/src/metadata/database.rs index 7907eb047..bfb50dc94 100644 --- a/crates/query-engine/metadata/src/metadata/database.rs +++ b/crates/query-engine/metadata/src/metadata/database.rs @@ -249,6 +249,8 @@ pub enum TypeRepresentation { Number, /// Any JSON number, with no decimal part Integer, + /// An arbitrary json. + Json, /// One of the specified string values Enum(Vec), } diff --git a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap index 51e82e268..4e757f380 100644 --- a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__schema_tests__schema_test__get_schema.snap @@ -1272,7 +1272,7 @@ expression: result }, "int8": { "representation": { - "type": "int32" + "type": "json" }, "aggregate_functions": { "avg": { diff --git a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap index 4379f4848..29a676d95 100644 --- a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap +++ b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__schema_tests__schema_test__get_schema.snap @@ -809,7 +809,7 @@ expression: result }, "int8": { "representation": { - "type": "int32" + "type": "json" }, "aggregate_functions": { "avg": { diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap index 31fa8addc..9721dfa84 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_configuration_schema.snap @@ -1112,6 +1112,13 @@ expression: schema "integer" ] }, + { + "description": "An arbitrary json.", + "type": "string", + "enum": [ + "json" + ] + }, { "description": "One of the specified string values", "type": "object", diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap index 78dd85d84..c43556a7c 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__get_rawconfiguration_v3_schema.snap @@ -1100,6 +1100,13 @@ expression: schema "integer" ] }, + { + "description": "An arbitrary json.", + "type": "string", + "enum": [ + "json" + ] + }, { "description": "One of the specified string values", "type": "object", diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap index 0d02b139d..dbf464daf 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__postgres_current_only_configure_v3_initial_configuration_is_unchanged.snap @@ -2306,7 +2306,7 @@ expression: default_configuration "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "timestamp": "timestamp", diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap index f061a0ce1..55ad90917 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__openapi_tests__openapi__up_to_date_generated_schema.snap @@ -1090,6 +1090,13 @@ expression: generated_schema_json "integer" ] }, + { + "description": "An arbitrary json.", + "type": "string", + "enum": [ + "json" + ] + }, { "description": "One of the specified string values", "type": "object", 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 704f8de46..b8303dbc5 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 @@ -1356,7 +1356,7 @@ expression: result }, "int8": { "representation": { - "type": "int32" + "type": "json" }, "aggregate_functions": { "avg": { diff --git a/static/aurora/v3-chinook-ndc-metadata/configuration.json b/static/aurora/v3-chinook-ndc-metadata/configuration.json index 99f2c35a3..8ffebddd4 100644 --- a/static/aurora/v3-chinook-ndc-metadata/configuration.json +++ b/static/aurora/v3-chinook-ndc-metadata/configuration.json @@ -2781,7 +2781,7 @@ "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "time": "time", diff --git a/static/citus/v3-chinook-ndc-metadata/configuration.json b/static/citus/v3-chinook-ndc-metadata/configuration.json index 2aa450c17..76e2e5368 100644 --- a/static/citus/v3-chinook-ndc-metadata/configuration.json +++ b/static/citus/v3-chinook-ndc-metadata/configuration.json @@ -3309,7 +3309,7 @@ "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "time": "time", diff --git a/static/cockroach/v3-chinook-ndc-metadata/configuration.json b/static/cockroach/v3-chinook-ndc-metadata/configuration.json index 1a7c9807e..1d5ada77e 100644 --- a/static/cockroach/v3-chinook-ndc-metadata/configuration.json +++ b/static/cockroach/v3-chinook-ndc-metadata/configuration.json @@ -2808,7 +2808,7 @@ "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "time": "time", diff --git a/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json b/static/ndc-metadata-snapshots/36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25/configuration.json similarity index 99% rename from static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json rename to static/ndc-metadata-snapshots/36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25/configuration.json index 2167016c2..640eff7d4 100644 --- a/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/configuration.json +++ b/static/ndc-metadata-snapshots/36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25/configuration.json @@ -1095,7 +1095,7 @@ "only_occurring_here1": { "name": "only_occurring_here1", "type": { - "scalarType": "bit" + "scalarType": "int8" }, "description": null } @@ -3680,20 +3680,20 @@ "enum": ["hearts", "clubs", "diamonds", "spades"] }, "char": "string", - "date": "string", - "even_number": "integer", - "float4": "number", - "float8": "number", - "int2": "integer", - "int4": "integer", - "int8": "integer", - "numeric": "number", + "date": "date", + "even_number": "int32", + "float4": "float32", + "float8": "float64", + "int2": "int16", + "int4": "int32", + "int8": "json", + "numeric": "bigDecimal", "text": "string", - "time": "string", - "timestamp": "string", - "timestamptz": "string", - "timetz": "string", - "uuid": "string", + "time": "time", + "timestamp": "timestamp", + "timestamptz": "timestamptz", + "timetz": "timetz", + "uuid": "uUID", "varchar": "string" } }, diff --git a/static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql b/static/ndc-metadata-snapshots/36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25/native_queries/summarize_organizations.sql similarity index 100% rename from static/ndc-metadata-snapshots/87355f24cd2eb6b5502f32274772b26e0068ecc23f4958ce3bee18be1e07c942/native_queries/summarize_organizations.sql rename to static/ndc-metadata-snapshots/36264e707213b310f71aa95e243dac882d03bb7504513773214b791828e58f25/native_queries/summarize_organizations.sql diff --git a/static/postgres/broken-queries-ndc-metadata/configuration.json b/static/postgres/broken-queries-ndc-metadata/configuration.json index cbb9f44f1..6666e6c74 100644 --- a/static/postgres/broken-queries-ndc-metadata/configuration.json +++ b/static/postgres/broken-queries-ndc-metadata/configuration.json @@ -300,7 +300,7 @@ }, "typeRepresentations": { "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal" } }, diff --git a/static/postgres/v3-chinook-ndc-metadata/configuration.json b/static/postgres/v3-chinook-ndc-metadata/configuration.json index 7e2d2a086..2efb38c78 100644 --- a/static/postgres/v3-chinook-ndc-metadata/configuration.json +++ b/static/postgres/v3-chinook-ndc-metadata/configuration.json @@ -3686,7 +3686,7 @@ "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "time": "time", diff --git a/static/schema.json b/static/schema.json index fc70f0f5b..04229371d 100644 --- a/static/schema.json +++ b/static/schema.json @@ -970,6 +970,11 @@ "type": "string", "enum": ["integer"] }, + { + "description": "An arbitrary json.", + "type": "string", + "enum": ["json"] + }, { "description": "One of the specified string values", "type": "object", diff --git a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json index a6dc346a9..a2bad8afc 100644 --- a/static/yugabyte/v3-chinook-ndc-metadata/configuration.json +++ b/static/yugabyte/v3-chinook-ndc-metadata/configuration.json @@ -3268,7 +3268,7 @@ "float8": "float64", "int2": "int16", "int4": "int32", - "int8": "int64", + "int8": "json", "numeric": "bigDecimal", "text": "string", "time": "time",