diff --git a/.github/test-configuration.json b/.github/test-configuration.json index fd54e7ed0..5a1c7fbdb 100644 --- a/.github/test-configuration.json +++ b/.github/test-configuration.json @@ -15,7 +15,7 @@ }, "ndc-postgres-12": { "feature": "postgres", - "filter": "not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)", + "filter": "not test(postgres_current_only)", "services": "postgres", "env": { "POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002", @@ -24,7 +24,7 @@ }, "ndc-postgres-13": { "feature": "postgres", - "filter": "not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)", + "filter": "not test(postgres_current_only)", "services": "postgres", "env": { "POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002", @@ -33,7 +33,7 @@ }, "ndc-postgres-14": { "feature": "postgres", - "filter": "not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)", + "filter": "not test(postgres_current_only)", "services": "postgres", "env": { "POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002", @@ -42,7 +42,7 @@ }, "ndc-postgres-15": { "feature": "postgres", - "filter": "not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)", + "filter": "not test(postgres_current_only)", "services": "postgres", "env": { "POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002", diff --git a/.github/workflows/cargo-test.yaml b/.github/workflows/cargo-test.yaml index cacf0ed5d..b5b7a717f 100644 --- a/.github/workflows/cargo-test.yaml +++ b/.github/workflows/cargo-test.yaml @@ -127,9 +127,13 @@ jobs: AURORA_CONNECTION_STRING: ${{ secrets.AURORA_CONNECTION_STRING }} run: | # take connection string from env, create deployment file with it - cat static/aurora/chinook-deployment-template.json \ + cat static/aurora/v1-chinook-deployment-template.json \ | jq '.connectionUri={"uri":{"value":(env | .AURORA_CONNECTION_STRING)}}' \ - > static/aurora/chinook-deployment.json + > static/aurora/v1-chinook-deployment.json + + cat static/aurora/v2-chinook-deployment-template.json \ + | jq '.connectionUri={"uri":{"value":(env | .AURORA_CONNECTION_STRING)}}' \ + > static/aurora/v2-chinook-deployment.json - name: install tools run: | diff --git a/changelog.md b/changelog.md index bdbe8fc28..6e1529665 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ ### Added +- Introduce version 2 of connector deployment configuration. ([#208](https://github.com/hasura/ndc-postgres/pull/208)) - Support array types ([#191](https://github.com/hasura/ndc-postgres/pull/191), ...) - Support Native Query Mutations ([#189](https://github.com/hasura/ndc-postgres/pull/189), [#198](https://github.com/hasura/ndc-postgres/pull/198)) diff --git a/crates/connectors/ndc-postgres/src/configuration.rs b/crates/connectors/ndc-postgres/src/configuration.rs index 7d6c6e692..1cac45326 100644 --- a/crates/connectors/ndc-postgres/src/configuration.rs +++ b/crates/connectors/ndc-postgres/src/configuration.rs @@ -1,17 +1,70 @@ //! Configuration for the connector. -mod version1; - -use std::collections::BTreeSet; +mod custom_trait_implementations; +pub mod version1; +pub mod version2; +use custom_trait_implementations::RawConfigurationCompat; +use ndc_sdk::connector; use query_engine_metadata::metadata; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +pub use version2::{occurring_scalar_types, ConnectionUri, PoolSettings, ResolvedSecret}; -pub use version1::{ - configure, metadata_to_current, validate_raw_configuration, Configuration, ConnectionUri, - PoolSettings, RawConfiguration, ResolvedSecret, -}; +/// Initial configuration, just enough to connect to a database and elaborate a full +/// 'Configuration'. +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(tag = "version")] +#[serde(try_from = "RawConfigurationCompat")] +#[serde(into = "RawConfigurationCompat")] +// NOTE: Any changes to this data type will need follow-up changes to the +// 'custom_trait_implementations' module. +pub enum RawConfiguration { + // Until https://github.com/serde-rs/serde/pull/2525 is merged enum tags have to be strings. + #[serde(rename = "1")] + Version1(version1::RawConfiguration), + #[serde(rename = "2")] + Version2(version2::RawConfiguration), +} + +impl RawConfiguration { + pub fn empty() -> Self { + RawConfiguration::Version2(version2::RawConfiguration::empty()) + } +} -pub const CURRENT_VERSION: u32 = 1; +/// User configuration, elaborated from a 'RawConfiguration'. +#[derive(Debug, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct Configuration { + pub config: RawConfiguration, +} + +pub async fn configure( + args: RawConfiguration, +) -> Result { + match args { + RawConfiguration::Version1(v1) => { + Ok(RawConfiguration::Version1(version1::configure(v1).await?)) + } + RawConfiguration::Version2(v2) => { + Ok(RawConfiguration::Version2(version2::configure(v2).await?)) + } + } +} +pub async fn validate_raw_configuration( + config: RawConfiguration, +) -> Result { + match config { + RawConfiguration::Version1(v1) => Ok(Configuration { + config: RawConfiguration::Version1(version1::validate_raw_configuration(v1).await?), + }), + RawConfiguration::Version2(v2) => Ok(Configuration { + config: RawConfiguration::Version2(version2::validate_raw_configuration(v2).await?), + }), + } +} /// A configuration type, tailored to the needs of the query/mutation/explain methods (i.e., those /// not to do with configuration management). @@ -25,54 +78,41 @@ pub const CURRENT_VERSION: u32 = 1; #[derive(Debug)] pub struct RuntimeConfiguration { pub metadata: metadata::Metadata, + pub pool_settings: version1::PoolSettings, + pub connection_uri: String, } -impl<'a> version1::Configuration { - /// Apply the common interpretations on the Configuration API type into an RuntimeConfiguration. - pub fn as_runtime_configuration(self: &'a Configuration) -> RuntimeConfiguration { - RuntimeConfiguration { - metadata: metadata_to_current(&self.config.metadata), - } +/// Apply the common interpretations on the Configuration API type into an RuntimeConfiguration. +pub fn as_runtime_configuration(config: &Configuration) -> RuntimeConfiguration { + match &config.config { + RawConfiguration::Version1(v1_config) => RuntimeConfiguration { + metadata: version1::metadata_to_current(&v1_config.metadata), + pool_settings: v1_config.pool_settings.clone(), + connection_uri: match &v1_config.connection_uri { + ConnectionUri::Uri(ResolvedSecret(uri)) => uri.clone(), + }, + }, + RawConfiguration::Version2(v2_config) => RuntimeConfiguration { + metadata: v2_config.metadata.clone(), + pool_settings: v2_config.pool_settings.clone(), + connection_uri: match &v2_config.connection_uri { + ConnectionUri::Uri(ResolvedSecret(uri)) => uri.clone(), + }, + }, } } -/// Collect all the types that can occur in the metadata. This is a bit circumstantial. A better -/// approach is likely to record scalar type names directly in the metadata via configuration.sql. -pub fn occurring_scalar_types( - tables: &metadata::TablesInfo, - native_queries: &metadata::NativeQueries, -) -> BTreeSet { - let tables_column_types = tables.0.values().flat_map(|v| { - v.columns - .values() - .map(|c| c.r#type.clone()) - .filter_map(some_scalar_type) - }); - - let native_queries_column_types = native_queries.0.values().flat_map(|v| { - v.columns - .values() - .map(|c| c.r#type.clone()) - .filter_map(some_scalar_type) - }); - - let native_queries_arguments_types = native_queries.0.values().flat_map(|v| { - v.arguments - .values() - .map(|c| c.r#type.clone()) - .filter_map(some_scalar_type) - }); - - tables_column_types - .chain(native_queries_column_types) - .chain(native_queries_arguments_types) - .collect::>() -} +// for tests -/// Filter predicate that only keeps scalar types. -fn some_scalar_type(typ: metadata::Type) -> Option { - match typ { - metadata::Type::ArrayType(_) => None, - metadata::Type::ScalarType(t) => Some(t), +pub fn set_connection_uri(config: RawConfiguration, connection_uri: String) -> RawConfiguration { + match config { + RawConfiguration::Version1(v1) => RawConfiguration::Version1(version1::RawConfiguration { + connection_uri: ConnectionUri::Uri(ResolvedSecret(connection_uri)), + ..v1 + }), + RawConfiguration::Version2(v2) => RawConfiguration::Version2(version2::RawConfiguration { + connection_uri: ConnectionUri::Uri(ResolvedSecret(connection_uri)), + ..v2 + }), } } diff --git a/crates/connectors/ndc-postgres/src/configuration/custom_trait_implementations.rs b/crates/connectors/ndc-postgres/src/configuration/custom_trait_implementations.rs new file mode 100644 index 000000000..4bd063ffc --- /dev/null +++ b/crates/connectors/ndc-postgres/src/configuration/custom_trait_implementations.rs @@ -0,0 +1,199 @@ +//! This module exists solely to support indicating version 1 with an integer literal. Once version +//! 1 is phased out completely, this file is to be deleted and trait implementations for +//! Serialize/Deserialize/JsonSchema reverted to their derived versions. + +use crate::configuration::version1; +use crate::configuration::version2; +use std::boxed::Box; +use std::fmt; + +use serde::{Deserialize, Serialize}; + +pub use crate::configuration::{Configuration, RawConfiguration}; + +#[derive(Clone, Deserialize, Serialize)] +pub struct RawConfigurationCompat(serde_json::Value); + +impl From for RawConfigurationCompat { + fn from(value: RawConfiguration) -> Self { + let val = match value { + RawConfiguration::Version1(v1) => { + let mut val = serde_json::to_value(v1).unwrap(); + let obj = val.as_object_mut().unwrap(); + + let mut res = serde_json::map::Map::new(); + res.insert("version".to_string(), serde_json::json!(1)); + res.append(obj); + serde_json::value::to_value(res).unwrap() + } + RawConfiguration::Version2(v2) => { + let mut val = serde_json::to_value(v2).unwrap(); + let obj = val.as_object_mut().unwrap(); + + let mut res = serde_json::map::Map::new(); + res.insert("version".to_string(), serde_json::json!("2")); + res.append(obj); + serde_json::value::to_value(res).unwrap() + } + }; + + RawConfigurationCompat(val) + } +} + +// Dump of derivied JsonSchema trait implementation, tweaked to put version as an integer for +// version 1. +// +// Generated with 'cargo expand --theme=gruvbox-light -p ndc-postgres --lib configuration'. This +// should be re-run whenever a new version is added (or removed entirely once version 1 is +// deprecated). +impl schemars::JsonSchema for RawConfiguration { + fn schema_name() -> std::string::String { + "RawConfiguration".to_owned() + } + fn schema_id() -> std::borrow::Cow<'static, str> { + std::borrow::Cow::Borrowed("ndc_postgres::configuration::RawConfiguration") + } + fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema { + { + let schema = schemars::schema::Schema::Object(schemars::schema::SchemaObject { + subschemas: Some(Box::new(schemars::schema::SubschemaValidation { + one_of: Some(<[_]>::into_vec(Box::new([ + schemars::schema::Schema::Object(schemars::schema::SchemaObject { + instance_type: Some(schemars::schema::InstanceType::Object.into()), + object: Some(Box::new(schemars::schema::ObjectValidation { + properties: { + let mut props = schemars::Map::new(); + props.insert( + "version".to_owned(), + schemars::schema::Schema::Object( + schemars::schema::SchemaObject { + instance_type: Some( + // Here is the only change, + // String -> Number + schemars::schema::InstanceType::Number.into(), + ), + enum_values: Some(<[_]>::into_vec(Box::new([ + "1".into() + ]))), + ..Default::default() + }, + ), + ); + props + }, + required: { + let mut required = schemars::Set::new(); + required.insert("version".to_owned()); + required + }, + ..Default::default() + })), + ..Default::default() + }) + .flatten( + ::json_schema(gen), + ), + schemars::schema::Schema::Object(schemars::schema::SchemaObject { + instance_type: Some(schemars::schema::InstanceType::Object.into()), + object: Some(Box::new(schemars::schema::ObjectValidation { + properties: { + let mut props = schemars::Map::new(); + props.insert( + "version".to_owned(), + schemars::schema::Schema::Object( + schemars::schema::SchemaObject { + instance_type: Some( + schemars::schema::InstanceType::String.into(), + ), + enum_values: Some(<[_]>::into_vec(Box::new([ + "2".into() + ]))), + ..Default::default() + }, + ), + ); + props + }, + required: { + let mut required = schemars::Set::new(); + required.insert("version".to_owned()); + required + }, + ..Default::default() + })), + ..Default::default() + }) + .flatten( + ::json_schema(gen), + ), + ]))), + ..Default::default() + })), + ..Default::default() + }); + schemars::_private::apply_metadata( + schema, + schemars::schema::Metadata { + description: Some( + "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'." + .to_owned(), + ), + ..Default::default() + }, + ) + } + } +} + +#[derive(Debug)] +pub enum RawConfigurationCompatError { + JsonError(serde_json::Error), + RawConfigurationCompatError { error_message: String }, +} + +impl fmt::Display for RawConfigurationCompatError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + RawConfigurationCompatError::JsonError(e) => write!(f, "{e}"), + RawConfigurationCompatError::RawConfigurationCompatError { error_message } => { + write!(f, "RawConfiguration serialization error: {error_message}") + } + } + } +} + +impl From for RawConfigurationCompatError { + fn from(value: serde_json::Error) -> Self { + RawConfigurationCompatError::JsonError(value) + } +} + +impl TryFrom for RawConfiguration { + type Error = RawConfigurationCompatError; + + fn try_from(value: RawConfigurationCompat) -> Result { + let version = value.0.get("version").ok_or( + RawConfigurationCompatError::RawConfigurationCompatError { + error_message: "Configuration data did not contain a \"version\" field." + .to_string(), + }, + )?; + match version.as_u64() { + Some(1) => Ok(RawConfiguration::Version1(serde_json::from_value(value.0)?)), + Some(n) => Err(RawConfigurationCompatError::RawConfigurationCompatError { + error_message: format!( + "Configuration data version key was an integer literal: {n}. The only supported integer version is 1." + ), + }), + None => match version.as_str() { + Some("1") => Ok(RawConfiguration::Version1(serde_json::from_value(value.0)?)), + Some("2") => Ok(RawConfiguration::Version2(serde_json::from_value(value.0)?)), + Some(v) => Err(RawConfigurationCompatError::RawConfigurationCompatError{error_message: + format!("Configuration data version unsupported: \"{v}\". Supported versions are: 1, and \"2\".")}), + None => Err(RawConfigurationCompatError::RawConfigurationCompatError{error_message: + "Configuration data version unsupported. Supported versions are: 1, and \"2\".".to_string()}), + }, + } + } +} diff --git a/crates/connectors/ndc-postgres/src/introspection-notes.md b/crates/connectors/ndc-postgres/src/configuration/introspection-notes.md similarity index 100% rename from crates/connectors/ndc-postgres/src/introspection-notes.md rename to crates/connectors/ndc-postgres/src/configuration/introspection-notes.md diff --git a/crates/connectors/ndc-postgres/src/configuration/version1.rs b/crates/connectors/ndc-postgres/src/configuration/version1.rs index 86d8b17e9..5e68fe67e 100644 --- a/crates/connectors/ndc-postgres/src/configuration/version1.rs +++ b/crates/connectors/ndc-postgres/src/configuration/version1.rs @@ -11,15 +11,13 @@ use std::collections::{BTreeMap, BTreeSet}; use query_engine_metadata::metadata; -const CURRENT_VERSION: u32 = 1; +const CONFIGURATION_QUERY: &str = include_str!("version1.sql"); /// Initial configuration, just enough to connect to a database and elaborate a full /// 'Configuration'. -#[derive(Debug, Deserialize, Serialize, JsonSchema)] +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct RawConfiguration { - // Which version of the configuration format are we using - pub version: u32, // Connection string for a Postgres-compatible database pub connection_uri: ConnectionUri, #[serde(skip_serializing_if = "PoolSettings::is_default")] @@ -32,7 +30,7 @@ pub struct RawConfiguration { } /// Options which only influence how the configuration server updates the configuration -#[derive(Debug, Deserialize, Serialize, JsonSchema)] +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct ConfigureOptions { /// Schemas which are excluded from introspection. The default setting will exclude the @@ -180,13 +178,6 @@ fn default_unqualified_schemas() -> Vec { vec!["public".to_string()] } -/// User configuration, elaborated from a 'RawConfiguration'. -#[derive(Debug, Deserialize, Serialize, JsonSchema)] -#[serde(rename_all = "camelCase")] -pub struct Configuration { - pub config: RawConfiguration, -} - // Configuration type for values that can come from secrets. That format includes both literal // values as well as symbolic references to secrets. // At this point we should only ever see resolved secrets, which this type captures. @@ -243,21 +234,16 @@ impl From<&str> for ConnectionUri { impl RawConfiguration { pub fn empty() -> Self { Self { - version: CURRENT_VERSION, connection_uri: ConnectionUri::Uri(ResolvedSecret("".to_string())), pool_settings: PoolSettings::default(), metadata: Metadata::default(), - configure_options: ConfigureOptions { - excluded_schemas: default_excluded_schemas(), - unqualified_schemas: default_unqualified_schemas(), - comparison_operator_mapping: default_comparison_operator_mapping(), - }, + configure_options: ConfigureOptions::default(), } } } /// Settings for the PostgreSQL connection pool -#[derive(Debug, PartialEq, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct PoolSettings { /// maximum number of pool connections @@ -275,7 +261,7 @@ pub struct PoolSettings { } impl PoolSettings { - fn is_default(&self) -> bool { + pub fn is_default(&self) -> bool { self == &PoolSettings::default() } } @@ -309,19 +295,7 @@ fn connection_lifetime_default() -> Option { /// Validate the user configuration. pub async fn validate_raw_configuration( config: RawConfiguration, -) -> Result { - if config.version != 1 { - return Err(connector::ValidateError::ValidateError(vec![ - connector::InvalidRange { - path: vec![connector::KeyOrIndex::Key("version".into())], - message: format!( - "invalid configuration version, expected 1, got {0}", - config.version - ), - }, - ])); - } - +) -> Result { match &config.connection_uri { ConnectionUri::Uri(ResolvedSecret(uri)) if uri.is_empty() => { Err(connector::ValidateError::ValidateError(vec![ @@ -334,13 +308,12 @@ pub async fn validate_raw_configuration( _ => Ok(()), }?; - Ok(Configuration { config }) + Ok(config) } /// Construct the deployment configuration by introspecting the database. pub async fn configure( args: RawConfiguration, - configuration_query: &str, ) -> Result { let ConnectionUri::Uri(ResolvedSecret(uri)) = &args.connection_uri; @@ -349,7 +322,7 @@ pub async fn configure( .await .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; - let query = sqlx::query(configuration_query) + let query = sqlx::query(CONFIGURATION_QUERY) .bind(args.configure_options.excluded_schemas.clone()) .bind(args.configure_options.unqualified_schemas.clone()) .bind( @@ -394,7 +367,6 @@ pub async fn configure( filter_aggregate_functions(&scalar_types, aggregate_functions); Ok(RawConfiguration { - version: 1, connection_uri: args.connection_uri, pool_settings: args.pool_settings, metadata: Metadata { @@ -407,7 +379,11 @@ pub async fn configure( }) } -fn filter_comparison_operators( +/// Filter predicate for comarison operators. Preserves only comparison operators that are +/// relevant to any of the given scalar types. +/// +/// This function is public to enable use in later versions that retain the same metadata types. +pub fn filter_comparison_operators( scalar_types: &BTreeSet, comparison_operators: metadata::ComparisonOperators, ) -> metadata::ComparisonOperators { @@ -428,7 +404,11 @@ fn filter_comparison_operators( ) } -fn filter_aggregate_functions( +/// Filter predicate for aggregation functions. Preserves only aggregation functions that are +/// relevant to any of the given scalar types. +/// +/// This function is public to enable use in later versions that retain the same metadata types. +pub fn filter_aggregate_functions( scalar_types: &BTreeSet, aggregate_functions: metadata::AggregateFunctions, ) -> metadata::AggregateFunctions { @@ -450,8 +430,8 @@ fn filter_aggregate_functions( } /// Collect all the types that can occur in the metadata. This is a bit circumstantial. A better -/// approach is likely to record scalar type names directly in the metadata via configuration.sql. -pub fn occurring_scalar_types( +/// approach is likely to record scalar type names directly in the metadata via version1.sql. +fn occurring_scalar_types( tables: &TablesInfo, native_queries: &NativeQueries, ) -> BTreeSet { @@ -550,7 +530,7 @@ fn native_query_to_current(nq: &NativeQueryInfo) -> metadata::NativeQueryInfo { } /// Metadata information. -#[derive(Debug, Default, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct Metadata { #[serde(default)] diff --git a/crates/connectors/ndc-postgres/src/configuration.sql b/crates/connectors/ndc-postgres/src/configuration/version1.sql similarity index 100% rename from crates/connectors/ndc-postgres/src/configuration.sql rename to crates/connectors/ndc-postgres/src/configuration/version1.sql diff --git a/crates/connectors/ndc-postgres/src/configuration/version2.rs b/crates/connectors/ndc-postgres/src/configuration/version2.rs new file mode 100644 index 000000000..d076fa793 --- /dev/null +++ b/crates/connectors/ndc-postgres/src/configuration/version2.rs @@ -0,0 +1,172 @@ +//! Internal Configuration and state for our connector. +use tracing::{info_span, Instrument}; + +use ndc_sdk::connector; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use sqlx::postgres::PgConnection; +use sqlx::{Connection, Executor, Row}; +use std::collections::BTreeSet; + +use query_engine_metadata::metadata; + +use crate::configuration::version1; + +pub use version1::{ConnectionUri, PoolSettings, ResolvedSecret}; + +const CONFIGURATION_QUERY: &str = include_str!("version2.sql"); + +/// Initial configuration, just enough to connect to a database and elaborate a full +/// 'Configuration'. +#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)] +#[serde(rename_all = "camelCase")] +pub struct RawConfiguration { + // Connection string for a Postgres-compatible database + pub connection_uri: version1::ConnectionUri, + #[serde(skip_serializing_if = "version1::PoolSettings::is_default")] + #[serde(default)] + pub pool_settings: version1::PoolSettings, + #[serde(default)] + pub metadata: metadata::Metadata, + #[serde(default)] + pub configure_options: version1::ConfigureOptions, +} + +impl RawConfiguration { + pub fn empty() -> Self { + Self { + connection_uri: version1::ConnectionUri::Uri(version1::ResolvedSecret("".to_string())), + pool_settings: version1::PoolSettings::default(), + metadata: metadata::Metadata::default(), + configure_options: version1::ConfigureOptions::default(), + } + } +} + +/// Validate the user configuration. +pub async fn validate_raw_configuration( + config: RawConfiguration, +) -> Result { + match &config.connection_uri { + version1::ConnectionUri::Uri(version1::ResolvedSecret(uri)) if uri.is_empty() => { + Err(connector::ValidateError::ValidateError(vec![ + connector::InvalidRange { + path: vec![connector::KeyOrIndex::Key("connectionUri".into())], + message: "database uri must be specified".to_string(), + }, + ])) + } + _ => Ok(()), + }?; + + Ok(config) +} + +/// Construct the deployment configuration by introspecting the database. +pub async fn configure( + args: RawConfiguration, +) -> Result { + let version1::ConnectionUri::Uri(version1::ResolvedSecret(uri)) = &args.connection_uri; + + let mut connection = PgConnection::connect(uri.as_str()) + .instrument(info_span!("Connect to database")) + .await + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; + + let query = sqlx::query(CONFIGURATION_QUERY) + .bind(args.configure_options.excluded_schemas.clone()) + .bind(args.configure_options.unqualified_schemas.clone()) + .bind( + serde_json::to_value(args.configure_options.comparison_operator_mapping.clone()) + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?, + ); + + let row = connection + .fetch_one(query) + .instrument(info_span!("Run introspection query")) + .await + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; + + let (tables, aggregate_functions, comparison_operators) = async { + let tables: metadata::TablesInfo = serde_json::from_value(row.get(0)) + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; + + let aggregate_functions: metadata::AggregateFunctions = serde_json::from_value(row.get(1)) + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; + + let comparison_operators: metadata::ComparisonOperators = + serde_json::from_value(row.get(2)) + .map_err(|e| connector::UpdateConfigurationError::Other(e.into()))?; + + // We need to specify the concrete return type explicitly so that rustc knows that it can + // be sent across an async boundary. + // (last verified with rustc 1.72.1) + Ok::<_, connector::UpdateConfigurationError>(( + tables, + aggregate_functions, + comparison_operators, + )) + } + .instrument(info_span!("Decode introspection result")) + .await?; + + let scalar_types = occurring_scalar_types(&tables, &args.metadata.native_queries); + + let relevant_comparison_operators = + version1::filter_comparison_operators(&scalar_types, comparison_operators); + let relevant_aggregate_functions = + version1::filter_aggregate_functions(&scalar_types, aggregate_functions); + + Ok(RawConfiguration { + connection_uri: args.connection_uri, + pool_settings: args.pool_settings, + metadata: metadata::Metadata { + tables, + native_queries: args.metadata.native_queries, + aggregate_functions: relevant_aggregate_functions, + comparison_operators: relevant_comparison_operators, + }, + configure_options: args.configure_options, + }) +} + +/// Collect all the types that can occur in the metadata. This is a bit circumstantial. A better +/// approach is likely to record scalar type names directly in the metadata via version2.sql. +pub fn occurring_scalar_types( + tables: &metadata::TablesInfo, + native_queries: &metadata::NativeQueries, +) -> BTreeSet { + let tables_column_types = tables.0.values().flat_map(|v| { + v.columns + .values() + .map(|c| c.r#type.clone()) + .filter_map(some_scalar_type) + }); + + let native_queries_column_types = native_queries.0.values().flat_map(|v| { + v.columns + .values() + .map(|c| c.r#type.clone()) + .filter_map(some_scalar_type) + }); + + let native_queries_arguments_types = native_queries.0.values().flat_map(|v| { + v.arguments + .values() + .map(|c| c.r#type.clone()) + .filter_map(some_scalar_type) + }); + + tables_column_types + .chain(native_queries_column_types) + .chain(native_queries_arguments_types) + .collect::>() +} + +/// Filter predicate that only keeps scalar types. +fn some_scalar_type(typ: metadata::Type) -> Option { + match typ { + metadata::Type::ArrayType(_) => None, + metadata::Type::ScalarType(t) => Some(t), + } +} diff --git a/crates/connectors/ndc-postgres/src/configuration/version2.sql b/crates/connectors/ndc-postgres/src/configuration/version2.sql new file mode 100644 index 000000000..10e321e79 --- /dev/null +++ b/crates/connectors/ndc-postgres/src/configuration/version2.sql @@ -0,0 +1,902 @@ +-- This query introspects the relations and types defined in the connected +-- database using the system catalog tables in the `pg_catalog` namespace. +-- +-- The data model of these tables is quite involved and carries with it decades +-- of legacy. Supporting notes on this are kept in 'introspection-notes.md'. +-- +-- TODO: This uses unqualified table (and view) and constraint names. +-- We will need to qualify them at some point. This makes the aliases seem +-- redundant, but they will change in the future. +-- If similar named tables exist in different schemas it is arbitrary +-- which one we pick currently! (c.f. Citus schemas 'columnar' and +-- 'columnar_internal' which both have a 'chunk' table) + +-- When debugging in 'psql', uncomment the lines below to be able to run the +-- query with arguments set. + +-- DEALLOCATE ALL; -- Or use 'DEALLOCATE configuration' between reloads +-- PREPARE configuration(varchar[], varchar[], jsonb) AS + +WITH + -- The overall structure of this query is a CTE (i.e. 'WITH .. SELECT') + -- statement which define projections of the catalog tables into forms that are + -- more convenient to work with: + -- + -- * We project only the columns that we need for constructing the ndc instance + -- schema and serving queries, and we try apply consistent naming. + -- + -- * We resolve references (oid's) to names. + -- + -- * We avoid aggregations over sub-selects and lateral joins since those have + -- proven brittle across postgres variants by experience. Instead we use + -- regular joins over tables that have been grouped by the join key to ensure + -- the 1:1 correspondance. + -- + -- One benefit of using a CTE is that it's easy to experiment with the query, + -- as you can query each of the WITH-bound sub-queries independently in the + -- main statement. + + -- Schemas are recorded in `pg_namespace`, see + -- https://www.postgresql.org/docs/current/catalog-pg-namespace.html for its + -- schema. + schemas AS + ( + SELECT + ns.oid AS schema_id, + ns.nspname AS schema_name + FROM pg_namespace AS ns + WHERE + -- Various schemas are patently uninteresting: + NOT (ns.nspname = ANY ($1)) + ), + + -- Tables and views etc. are recorded in `pg_class`, see + -- https://www.postgresql.org/docs/current/catalog-pg-class.html for its + -- schema. + relations AS + ( + SELECT + cl.relnamespace AS schema_id, + cl.oid AS relation_id, + cl.relname relation_name, + cl.relkind relation_kind + FROM + pg_class cl + ), + queryable_relations AS + ( + SELECT DISTINCT ON (relation_name) relations.* + FROM relations + WHERE relation_kind IN + -- Lots of different types of relations exist, but we're only interested in + -- the ones that can be queried. + ( + 'r', -- = ordinary table + 'v', -- = view + 'm', -- = materialized view + 'f', -- = foreign table + 'p' -- = partitioned table + -- i = index, + -- S = sequence, + -- t = TOAST table, + -- c = composite type, + -- I = partitioned index + ) + + -- Since we will _not_ be grouping by a key we need this to be ordered + -- to get deterministic results. + -- (Specificically, we do not yet take schemas into account) + ORDER BY relation_name, schema_id, relation_kind + ), + + -- Columns are recorded in `pg_attribute`. An 'attribute' is the generic term + -- for the parts that together make up a relation in general, and only in the + -- case of a table do we actually call them 'columns'. See + -- https://www.postgresql.org/docs/current/catalog-pg-attribute.html for its + -- schema. + columns AS + ( + SELECT + att.attrelid AS relation_id, + att.attname AS column_name, + att.attnum AS column_number, + att.atttypid AS type_id, + CASE WHEN att.attnotnull THEN 'nonNullable' ELSE 'nullable' END + AS nullable + -- Columns that will likely be of interest soon: + -- attidentity + -- attgenerated + -- atthasdef + FROM + pg_catalog.pg_attribute AS att + WHERE + -- We only include columns that are actually part of the table currently. + NOT att.attisdropped -- This table also records historic columns. + AND att.attnum > 0 -- attnum <= 0 are special system-defined columns. + ), + + -- Comments on database objects are recorded in `pg_description`. See + -- 'https://www.postgresql.org/docs/current/catalog-pg-description.html' for its schema. + -- + -- The modelling has some non-obvious use of indirection, which smells a bit + -- of Russel's paradox: 'classoid' is a 'pg_class.oid' value, which indicates + -- which _other_ pg_catalog table you need to consult in order to find the + -- object with oid 'objoid'. + -- + -- As an example, the comment of a table or view column will always have + -- + -- (classoid = 1259) + -- + -- since the 'pg_class.oid' 1259 refers to the 'pg_class' table _itself_ + -- (remember that, since 'pg_class' records all tables (and other relations) + -- that exist in the database, it also has a record of itself). + -- + -- We assume 'classoid' to be stable and will just use literal values rather + -- than actually looking them up in pg_class. + column_comments AS + ( + SELECT + col.relation_id, + col.column_name, + comm.description + FROM + ( + SELECT + objoid AS relation_id, + objsubid AS column_number, + description + FROM + pg_description + WHERE + classoid = 1259 + ) AS comm + INNER JOIN + columns + AS col + USING (relation_id, column_number) + ), + table_comments AS + ( + SELECT + objoid AS relation_id, + description + FROM + pg_description + WHERE + classoid = 1259 + AND objsubid = 0 + ), + + -- Types are recorded in 'pg_types', see + -- https://www.postgresql.org/docs/current/catalog-pg-type.html for its + -- schema. + scalar_types AS + ( + SELECT + t.oid AS type_id, + t.typnamespace AS schema_id, + t.typname AS type_name + -- Columns that will likely be of interest soon: + -- typedelim + FROM + pg_catalog.pg_type AS t + WHERE + -- We currently filter out pseudo (polymorphic) types, because our schema + -- can only deal with monomorphic types. + -- + -- We also filter out composite (record) types and arrays. We would like + -- to support those properly, which requires support in the schema and + -- query execution. If we export them as opaque scalar types, adding + -- proper support later becomes a breaking change, which we'd like to + -- avoid. + t.typtype NOT IN + ( + -- Interesting t.typtype 'types of types': + -- 'b' for base type + 'c', --for composite type + -- 'd' for domain (a predicate-restricted version of a type) + -- 'e' for enum + 'p' -- for pseudo-type (anyelement etc) + -- 'r' for range + -- 'm' for multi-range + ) + AND NOT ( + -- Exclude arrays (see 'array_types' below). + t.typelem != 0 -- whether you can subscript into the type + AND typcategory = 'A' -- The parsers considers this type an array for + -- the purpose of selecting preferred implicit casts. + ) + ), + array_types AS + ( + SELECT + t.oid AS type_id, + t.typnamespace AS schema_id, + et.type_name as element_type_name + FROM + pg_catalog.pg_type AS t + INNER JOIN + -- Postgres does not distinguish nested arrays at the type level, so we + -- can already tell what the element type is. + scalar_types + AS et + ON (et.type_id = t.typelem) + WHERE + -- See 'scalar_types' above + t.typtype NOT IN + ( + -- Interesting t.typtype 'types of types': + -- 'b' for base type + 'c', --for composite type + -- 'd' for domain (a predicate-restricted version of a type) + -- 'e' for enum + 'p' -- for pseudo-type (anyelement etc) + -- 'r' for range + -- 'm' for multi-range + ) + -- What makes a type an 'array' type in postgres is a surprisingly + -- nuanced question. + -- + -- Ideally, we should identify the types we consider array types for + -- ndc purposes as those which postgres calls 'true array types', since + -- those are the ones you can query as arrays (i.e., call 'unnest' on) + -- and which ought reasonably to display as arrays, see + -- introspection-notes.md. + -- + -- There might be other types which will display as arrays (e.g., when + -- serializing to json), but we shouldn't recognize those as arrays + -- in the schema, because we cannot expect to be able to exploit that + -- structure when querying. + -- + -- The check for whether a type is a 'true array type' is not portable + -- across Postgres and CockroachDB. + -- Here we're interested in censoring to avoid future breaking changes, + -- so we're content to censor a bit too much rather than too little. + -- + -- The best check I could come up with that works for the builtin types + -- and the PostGIS extension is this: + AND t.typelem != 0 -- whether you can subscript into the type + AND typcategory = 'A' -- The parsers considers this type an array for + -- the purpose of selecting preferred implicit casts. + ), + + -- Aggregate functions are recorded across 'pg_proc' and 'pg_aggregate', see + -- https://www.postgresql.org/docs/current/catalog-pg-proc.html and + -- https://www.postgresql.org/docs/current/catalog-pg-aggregate.html for + -- their schema. + aggregates AS + ( + WITH + -- The arguments to an aggregate function is an array of type oids, which + -- we want to resolve to an array of type names instead. + -- Somewhat awkwardly, this means we have to unnest, join on types, and + -- array_agg and group by. + aggregate_argument_types AS + ( + SELECT + arg.proc_id, + array_agg(arg.type_name) AS argument_types + FROM + ( + SELECT + proc.proc_id, + t.type_name + FROM + ( + SELECT + proc.oid AS proc_id, + unnest(proc.proargtypes) AS type_id + FROM + pg_catalog.pg_proc AS proc + WHERE + -- We only support single-argument aggregates currently. + -- This assertion is important to make here since joining with + -- 'types' filter arguments of polymorphic type, and we might + -- risk ending up with one argument later. + cardinality(proc.proargtypes) = 1 + ) + AS proc + INNER JOIN + scalar_types AS t + USING (type_id) + ) + AS arg + GROUP BY arg.proc_id + ) + SELECT + proc.oid AS proc_id, + proc.proname AS proc_name, + proc.pronamespace AS schema_id, + args.argument_types, + ret_type.type_name as return_type + + -- Columns that will likely be of interest soon: + -- proc.proargnames AS argument_names, + + FROM + pg_catalog.pg_proc AS proc + + INNER JOIN aggregate_argument_types + AS args + ON (proc.oid = args.proc_id) + + INNER JOIN scalar_types + AS ret_type + ON (ret_type.type_id = proc.prorettype) + + -- Restrict our scope to only aggregation functions + INNER JOIN pg_aggregate + ON (pg_aggregate.aggfnoid = proc.oid) + + WHERE + -- We are only interested in functions: + -- * Which are aggregation functions. + -- * Which don't take any 'direct' (i.e., non-aggregation) arguments + pg_aggregate.aggnumdirectargs = 0 + + ), + + -- Operators are recorded across 'pg_proc', pg_operator, and 'pg_aggregate', see + -- https://www.postgresql.org/docs/current/catalog-pg-proc.html, + -- https://www.postgresql.org/docs/current/catalog-pg-operator.html and + -- https://www.postgresql.org/docs/current/catalog-pg-aggregate.html for + -- their schema. + -- + -- In PostgreSQL, operators and aggregation functions each relate to a `pg_proc` + -- procedure. On CockroachDB, however, they are independent. + comparison_operators AS + ( + SELECT + op.oprname AS operator_name, + t1.type_name AS argument1_type, + t2.type_name AS argument2_type + FROM + pg_operator + AS op + INNER JOIN + scalar_types + AS t1 + ON (op.oprleft = t1.type_id) + INNER JOIN + scalar_types + AS t2 + ON (op.oprright = t2.type_id) + INNER JOIN + scalar_types + AS t_res + ON (op.oprresult = t_res.type_id) + WHERE + t_res.type_name = 'bool' + ORDER BY op.oprname + ), + + implicit_casts AS + ( + SELECT + t_from.type_name as from_type, + t_to.type_name as to_type + FROM + pg_cast + INNER JOIN + scalar_types + AS t_from + ON (t_from.type_id = pg_cast.castsource) + INNER JOIN + scalar_types + AS t_to + ON (t_to.type_id = pg_cast.casttarget) + WHERE + pg_cast.castcontext = 'i' + ), + + -- Some comparison operators are not defined explicitly for every type they would be + -- valid for, relying instead on implicit casts to extend the types they can apply to. + -- + -- Examples: + -- + -- Postgres only defines 'like' for 'text', not for 'varchar'. But there's + -- an implicit cast for varchar->text. + -- + -- CockroachDB does not define any comparison operators for 'float4', but + -- for 'float8', along with an implict cast for float4->float8. + -- + -- To make comparison operators available to all those types as well we + -- extend our set of operators to include implicit casts. + comparison_operators_cast_extended AS + ( + -- The left argument could have been cast. + SELECT + op.operator_name, + cast1.from_type as argument1_type, + op.argument2_type + FROM + comparison_operators + AS op + INNER JOIN + implicit_casts + AS cast1 + ON (cast1.to_type = op.argument1_type) + UNION + -- The right argument could have been cast. + SELECT + op.operator_name, + op.argument1_type, + cast2.from_type as argument2_type + FROM + comparison_operators + AS op + INNER JOIN + implicit_casts + AS cast2 + ON (cast2.to_type = op.argument2_type) + UNION + -- Both arguments could have been cast. + SELECT + op.operator_name, + cast1.from_type as argument1_type, + cast2.from_type as argument2_type + FROM + comparison_operators + AS op + INNER JOIN + implicit_casts + AS cast1 + ON (cast1.to_type = op.argument1_type) + INNER JOIN + implicit_casts + AS cast2 + ON (cast2.to_type = op.argument2_type) + UNION + -- Neither argument could have been cast. + SELECT * FROM comparison_operators + ), + + -- The names that comparison operators are exposed under is configurable. + operator_mappings AS + ( + SELECT + v ->> 'operatorName' AS operator_name, + v ->> 'exposedName' AS exposed_name + FROM + jsonb_array_elements($3) AS v + ), + + -- Constraints are recorded in 'pg_constraint', see + -- https://www.postgresql.org/docs/current/catalog-pg-constraint.html for its + -- schema. + -- + -- This form captures both uniqueness constraints and foreign key + -- constraints. The 'constraint_type' column determines which columns will be + -- non-null. + constraints AS + ( + WITH + -- The columns that make up a constraint are recorded in + -- pg_constraint(conkey, confkey), keyed by column number (attnum). + -- 'constraint_columns' and 'constraint_referenced_columns' dereference + -- these to column names. + -- + -- This involves unnesting, joining 'columns', and re-constructing the + -- array. + constraint_columns AS + ( + SELECT + c_unnest.constraint_id, + array_agg(col.column_name) as key_columns + FROM + ( + SELECT + c.oid as constraint_id, + c.conrelid as relation_id, + unnest(c.conkey) as column_number + FROM + pg_catalog.pg_constraint as c + ) AS c_unnest + INNER JOIN + columns col + USING (relation_id, column_number) + GROUP BY c_unnest.constraint_id + ), + constraint_referenced_columns AS + ( + SELECT + c_unnest.constraint_id, + array_agg(col.column_name) as referenced_columns + FROM + ( + SELECT + c.oid as constraint_id, + c.confrelid as relation_id, + unnest(c.confkey) as column_number + FROM + pg_catalog.pg_constraint as c + ) AS c_unnest + INNER JOIN + columns col + USING (relation_id, column_number) + GROUP BY c_unnest.constraint_id + ) + SELECT + c.oid as constraint_id, + c.connamespace as schema_id, + c.conname as constraint_name, + c.conrelid as relation_id, + c.contype as constraint_type, + con_cols.key_columns, + + -- These will be null for non-foreign- keys + c.confrelid as referenced_relation_id, + con_fcols.referenced_columns + FROM + pg_catalog.pg_constraint AS c + LEFT OUTER JOIN + constraint_columns as con_cols + ON (con_cols.constraint_id = c.oid) + LEFT OUTER JOIN + constraint_referenced_columns as con_fcols + ON (con_fcols.constraint_id = c.oid) + ), + uniqueness_constraints AS + ( + SELECT + constraint_id, + schema_id, + constraint_name, + relation_id, + key_columns + FROM + constraints AS c + WHERE + c.constraint_type in + ( + 'u', -- For uniqueness constraints + 'p' -- For primary keys + ) + ), + foreign_key_constraints AS + ( + SELECT + constraint_id, + schema_id, + constraint_name, + relation_id, + key_columns, + referenced_relation_id, + referenced_columns + FROM + constraints AS c + WHERE + c.constraint_type = 'f' -- For foreign-key constraints + ) +SELECT + coalesce(tables.result, '{}'::jsonb) AS "Tables" , + coalesce(aggregate_functions.result, '{}'::jsonb) AS "AggregateFunctions", + coalesce(comparison_functions.result, '{}'::jsonb) as "ComparisonFunctions" +FROM + ( + -- Tables and views + SELECT + jsonb_object_agg( + CASE + WHEN s.schema_name = ANY ($2) + THEN rel.relation_name + ELSE s.schema_name || '_' || rel.relation_name + END, + jsonb_build_object( + 'schemaName', + s.schema_name, + 'tableName', + rel.relation_name, + 'description', + comm.description, + 'columns', + columns_info.result, + 'uniquenessConstraints', + coalesce(uniqueness_constraints_info.result, '{}'::jsonb), + 'foreignRelations', + coalesce(foreign_key_constraints_info.result, '{}'::jsonb) + ) + ) + AS result + FROM + queryable_relations + AS rel + + LEFT OUTER JOIN + table_comments + AS comm + USING (relation_id) + + INNER JOIN schemas + AS s + USING (schema_id) + + -- Columns + INNER JOIN + ( + WITH + column_types AS + ( + SELECT + type_id, + jsonb_build_object( + 'scalarType', + type_name + ) + AS result + FROM + scalar_types + UNION + SELECT + type_id, + jsonb_build_object( + 'arrayType', + jsonb_build_object( + 'scalarType', + element_type_name + ) + ) + AS result + FROM + array_types + ) + SELECT + c.relation_id, + jsonb_object_agg( + c.column_name, + jsonb_build_object( + 'name', + c.column_name, + 'type', + t.result, + 'nullable', + c.nullable, + 'description', + comm.description + ) + ) + AS result + FROM columns + AS c + LEFT OUTER JOIN column_types + AS t + USING (type_id) + LEFT OUTER JOIN column_comments + AS comm + USING (relation_id, column_name) + GROUP BY relation_id + HAVING + -- All columns must have a supported type for us to list this table. + bool_and(NOT t.result IS NULL) + ) + AS columns_info + USING (relation_id) + + -- Uniqueness constraints + LEFT OUTER JOIN + ( + SELECT + con.relation_id, + jsonb_object_agg( + con.constraint_name, + to_jsonb(con.key_columns) + ) + AS result + FROM uniqueness_constraints + AS con + GROUP BY relation_id + ) + AS uniqueness_constraints_info + USING (relation_id) + + -- Foreign-key constraints. + LEFT OUTER JOIN + ( + -- These take on the form: + -- { + -- : + -- { + -- foreign_table: + -- , + -- column_mapping: + -- { + -- : + -- } + -- } + -- } + SELECT + con.relation_id, + jsonb_object_agg( + con.constraint_name, + jsonb_build_object( + 'foreignSchema', + foreign_schema.schema_name, + 'foreignTable', + foreign_relation.relation_name, + 'columnMapping', + con.column_mapping + ) + ) + AS result + FROM + ( + SELECT + con.relation_id, + con.constraint_name, + con.referenced_relation_id, + -- The column mapping is an object '{: }' + json_object_agg( + con.key_column, + con.referenced_column + ) AS column_mapping + FROM + ( + -- We need to unnest both the key_columns and referenced_columns, + -- which essentially works like 'unzip'. + -- The result is one row per column appearing in the constraint, + -- which we can then re-group and aggregate as json. + SELECT + relation_id, + constraint_name, + unnest(key_columns) as key_column, + referenced_relation_id, + unnest(referenced_columns) as referenced_column + FROM + foreign_key_constraints + ) + AS con + GROUP BY + (relation_id, constraint_name, referenced_relation_id) + ) + AS con + INNER JOIN relations + AS foreign_relation + ON foreign_relation.relation_id = con.referenced_relation_id + INNER JOIN schemas + AS foreign_schema + ON foreign_relation.schema_id = foreign_schema.schema_id + GROUP BY con.relation_id + ) + AS foreign_key_constraints_info + USING (relation_id) + + ) AS tables + + -- Aggregation functions + CROSS JOIN + ( + -- These are represented as a json object which takes on the form: + -- + -- { + -- : + -- { + -- : + -- { + -- 'return_type': + -- } + -- } + -- } + -- + SELECT + jsonb_object_agg( + agg.argument_type, + agg.routines + ) AS result + FROM + ( + SELECT + agg.argument_type, + jsonb_object_agg( + -- Since we are _not_ grouping by a key we need 'agg' to be ordered + -- and distinct to get deterministic results. + -- I.e. both functions 'f: A -> B' and 'f: A -> C' can coexist, but we + -- can only chose one with our current scheme + agg.proc_name, + jsonb_build_object( + 'returnType', + agg.return_type + ) + ) AS routines + FROM + ( + -- We only support aggregation functions that take a single argument. + SELECT DISTINCT ON (argument_type, proc_name) + agg.proc_name, + agg.argument_types[1] as argument_type, + agg.return_type + FROM + aggregates AS agg + ORDER BY argument_type, proc_name, return_type + ) AS agg + GROUP BY agg.argument_type + ) AS agg + ) AS aggregate_functions + + CROSS JOIN + ( + -- Comparison Operators + WITH + comparison_operators_mapped AS + ( + SELECT + map.exposed_name, + op.operator_name, + op.argument1_type, + op.argument2_type + FROM + comparison_operators_cast_extended + AS op + INNER JOIN + operator_mappings + AS map + USING (operator_name) + ), + + -- When an operator is overloaded for a type (either explicitly or + -- through implict casts), prefer the version where both arguments are + -- the same type. + comparison_operators_filtered AS + ( + SELECT DISTINCT ON (op.exposed_name, op.argument1_type) + op.exposed_name, + op.operator_name, + op.argument1_type, + op.argument2_type + FROM + comparison_operators_mapped + AS op + ORDER BY + op.exposed_name, + op.argument1_type, + op.argument1_type = op.argument2_type DESC + ), + + comparison_operators_by_first_arg AS + ( + SELECT + op.argument1_type, + jsonb_object_agg( + op.exposed_name, + jsonb_build_object( + 'operatorName', op.operator_name, + 'argumentType', op.argument2_type + ) + ) + AS result + FROM + comparison_operators_filtered + AS op + GROUP BY op.argument1_type + ) + SELECT + jsonb_object_agg( + op.argument1_type, + op.result + ) as result + FROM + comparison_operators_by_first_arg + AS op + ) AS comparison_functions; + +-- Uncomment the following lines to just run the configuration query with reasonable default arguments +-- +-- EXECUTE configuration( +-- '{"information_schema", "tiger", "pg_catalog", "topology"}'::varchar[], +-- '{}'::varchar[], +-- '[ +-- {"operatorName": "=", "exposedName": "_eq"}, +-- {"operatorName": "!=", "exposedName": "_neq"}, +-- {"operatorName": "<>", "exposedName": "_neq"}, +-- {"operatorName": "<=", "exposedName": "_lte"}, +-- {"operatorName": ">", "exposedName": "_gt"}, +-- {"operatorName": ">=", "exposedName": "_gte"}, +-- {"operatorName": "<", "exposedName": "_lt"}, +-- {"operatorName": "~~", "exposedName": "_like"}, +-- {"operatorName": "!~~", "exposedName": "_nlike"}, +-- {"operatorName": "~~*", "exposedName": "_ilike"}, +-- {"operatorName": "!~~*", "exposedName": "_nilike"}, +-- {"operatorName": "~", "exposedName": "_regex"}, +-- {"operatorName": "!~", "exposedName": "_nregex"}, +-- {"operatorName": "~*", "exposedName": "_iregex"}, +-- {"operatorName": "!~*", "exposedName": "_niregex"} +-- ]'::jsonb); diff --git a/crates/connectors/ndc-postgres/src/connector.rs b/crates/connectors/ndc-postgres/src/connector.rs index c532a6ffe..a90793e88 100644 --- a/crates/connectors/ndc-postgres/src/connector.rs +++ b/crates/connectors/ndc-postgres/src/connector.rs @@ -23,8 +23,6 @@ use super::query; use super::schema; use super::state; -const CONFIGURATION_QUERY: &str = include_str!("configuration.sql"); - #[derive(Clone, Default)] pub struct Postgres {} @@ -46,7 +44,7 @@ impl connector::Connector for Postgres { async fn update_configuration( args: Self::RawConfiguration, ) -> Result { - configuration::configure(args, CONFIGURATION_QUERY) + configuration::configure(args) .instrument(info_span!("Update configuration")) .await .map_err(|err| { @@ -88,22 +86,28 @@ impl connector::Connector for Postgres { configuration: &Self::Configuration, metrics: &mut prometheus::Registry, ) -> Result { - state::create_state(configuration, metrics) - .instrument(info_span!("Initialise state")) - .await - .map(Arc::new) - .map_err(|err| connector::InitializationError::Other(err.into())) - .map_err(|err| { - tracing::error!( - meta.signal_type = "log", - event.domain = "ndc", - event.name = "Initialization error", - name = "Initialization error", - body = %err, - error = true, - ); - err - }) + let runtime_configuration = configuration::as_runtime_configuration(configuration); + + state::create_state( + &runtime_configuration.connection_uri, + &runtime_configuration.pool_settings, + metrics, + ) + .instrument(info_span!("Initialise state")) + .await + .map(Arc::new) + .map_err(|err| connector::InitializationError::Other(err.into())) + .map_err(|err| { + tracing::error!( + meta.signal_type = "log", + event.domain = "ndc", + event.name = "Initialization error", + name = "Initialization error", + body = %err, + error = true, + ); + err + }) } /// Update any metrics from the state @@ -157,7 +161,8 @@ impl connector::Connector for Postgres { async fn get_schema( configuration: &Self::Configuration, ) -> Result, connector::SchemaError> { - schema::get_schema(configuration) + let runtime_configuration = configuration::as_runtime_configuration(configuration); + schema::get_schema(&runtime_configuration) .await .map_err(|err| { tracing::error!( @@ -182,8 +187,8 @@ impl connector::Connector for Postgres { state: &Self::State, query_request: models::QueryRequest, ) -> Result, connector::ExplainError> { - let conf = &configuration.as_runtime_configuration(); - explain::explain(conf, state, query_request) + let runtime_configuration = configuration::as_runtime_configuration(configuration); + explain::explain(&runtime_configuration, state, query_request) .await .map_err(|err| { tracing::error!( @@ -208,8 +213,8 @@ impl connector::Connector for Postgres { state: &Self::State, request: models::MutationRequest, ) -> Result, connector::MutationError> { - let conf = &configuration.as_runtime_configuration(); - mutation::mutation(conf, state, request) + let runtime_configuration = configuration::as_runtime_configuration(configuration); + mutation::mutation(&runtime_configuration, state, request) .await .map_err(|err| { tracing::error!( @@ -233,8 +238,8 @@ impl connector::Connector for Postgres { state: &Self::State, query_request: models::QueryRequest, ) -> Result, connector::QueryError> { - let conf = &configuration.as_runtime_configuration(); - query::query(conf, state, query_request) + let runtime_configuration = configuration::as_runtime_configuration(configuration); + query::query(&runtime_configuration, state, query_request) .await .map_err(|err| { tracing::error!( diff --git a/crates/connectors/ndc-postgres/src/schema.rs b/crates/connectors/ndc-postgres/src/schema.rs index 11a77b59a..bbe04176e 100644 --- a/crates/connectors/ndc-postgres/src/schema.rs +++ b/crates/connectors/ndc-postgres/src/schema.rs @@ -16,9 +16,9 @@ use super::configuration; /// This function implements the [schema endpoint](https://hasura.github.io/ndc-spec/specification/schema/index.html) /// from the NDC specification. pub async fn get_schema( - config: &configuration::Configuration, + config: &configuration::RuntimeConfiguration, ) -> Result { - let configuration::RuntimeConfiguration { metadata } = config.as_runtime_configuration(); + let configuration::RuntimeConfiguration { metadata, .. } = config; let scalar_types: BTreeMap = configuration::occurring_scalar_types(&metadata.tables, &metadata.native_queries) .iter() diff --git a/crates/connectors/ndc-postgres/src/state.rs b/crates/connectors/ndc-postgres/src/state.rs index f1dbf86a1..1cf4e1957 100644 --- a/crates/connectors/ndc-postgres/src/state.rs +++ b/crates/connectors/ndc-postgres/src/state.rs @@ -9,7 +9,7 @@ use thiserror::Error; use tracing::{info_span, Instrument}; use url::Url; -use crate::configuration::{Configuration, ConnectionUri, PoolSettings, ResolvedSecret}; +use crate::configuration::PoolSettings; use query_engine_execution::database_info::{self, DatabaseInfo, DatabaseVersion}; use query_engine_execution::metrics; @@ -23,14 +23,13 @@ pub struct State { /// Create a connection pool and wrap it inside a connector State. pub async fn create_state( - configuration: &Configuration, + connection_uri: &str, + pool_settings: &PoolSettings, metrics_registry: &mut prometheus::Registry, ) -> Result { - let ConnectionUri::Uri(ResolvedSecret(connection_uri)) = &configuration.config.connection_uri; let connection_url: Url = connection_uri .parse() .map_err(InitializationError::InvalidConnectionUri)?; - let pool_settings = &configuration.config.pool_settings; let pool = create_pool(&connection_url, pool_settings) .instrument(info_span!("Create connection pool")) .await?; diff --git a/crates/documentation/openapi/src/snapshots/openapi_generator__tests__main.snap b/crates/documentation/openapi/src/snapshots/openapi_generator__tests__main.snap index 0d533f0e3..f8ac012d8 100644 --- a/crates/documentation/openapi/src/snapshots/openapi_generator__tests__main.snap +++ b/crates/documentation/openapi/src/snapshots/openapi_generator__tests__main.snap @@ -6,143 +6,290 @@ expression: generated_schema_json "$schema": "https://spec.openapis.org/oas/3.0/schema/2019-04-02#/definitions/Schema", "title": "RawConfiguration", "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", - "type": "object", - "required": [ - "connectionUri", - "version" - ], - "properties": { - "version": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "connectionUri": { - "$ref": "#/components/schemas/ConnectionUri" - }, - "poolSettings": { - "$ref": "#/components/schemas/PoolSettings" - }, - "metadata": { - "default": { - "tables": {}, - "nativeQueries": {}, - "aggregateFunctions": {}, - "comparisonOperators": {} - }, - "allOf": [ - { - "$ref": "#/components/schemas/Metadata" - } - ] - }, - "configureOptions": { - "default": { - "excludedSchemas": [ - "information_schema", - "pg_catalog", - "tiger", - "crdb_internal", - "columnar", - "columnar_internal" - ], - "unqualifiedSchemas": [ - "public" - ], - "comparisonOperatorMapping": [ - { - "operatorName": "=", - "exposedName": "_eq" - }, - { - "operatorName": "<=", - "exposedName": "_lte" - }, - { - "operatorName": ">", - "exposedName": "_gt" - }, - { - "operatorName": ">=", - "exposedName": "_gte" - }, - { - "operatorName": "<", - "exposedName": "_lt" - }, - { - "operatorName": "!=", - "exposedName": "_neq" - }, - { - "operatorName": "LIKE", - "exposedName": "_like" - }, - { - "operatorName": "NOT LIKE", - "exposedName": "_nlike" - }, - { - "operatorName": "ILIKE", - "exposedName": "_ilike" - }, - { - "operatorName": "NOT ILIKE", - "exposedName": "_nilike" - }, - { - "operatorName": "SIMILAR TO", - "exposedName": "_similar" - }, - { - "operatorName": "NOT SIMILAR TO", - "exposedName": "_nsimilar" - }, - { - "operatorName": "<>", - "exposedName": "_neq" - }, - { - "operatorName": "~~", - "exposedName": "_like" - }, - { - "operatorName": "!~~", - "exposedName": "_nlike" - }, - { - "operatorName": "~~*", - "exposedName": "_ilike" - }, - { - "operatorName": "!~~*", - "exposedName": "_nilike" + "oneOf": [ + { + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri", + "version" + ], + "properties": { + "version": { + "type": "number", + "enum": [ + "1" + ] + }, + "connectionUri": { + "$ref": "#/components/schemas/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/components/schemas/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} }, - { - "operatorName": "~", - "exposedName": "_regex" + "allOf": [ + { + "$ref": "#/components/schemas/Metadata" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] }, - { - "operatorName": "!~", - "exposedName": "_nregex" + "allOf": [ + { + "$ref": "#/components/schemas/ConfigureOptions" + } + ] + } + } + }, + { + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri", + "version" + ], + "properties": { + "version": { + "type": "string", + "enum": [ + "2" + ] + }, + "connectionUri": { + "$ref": "#/components/schemas/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/components/schemas/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} }, - { - "operatorName": "~*", - "exposedName": "_iregex" + "allOf": [ + { + "$ref": "#/components/schemas/Metadata2" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] }, - { - "operatorName": "!~*", - "exposedName": "_niregex" - } - ] - }, - "allOf": [ - { - "$ref": "#/components/schemas/ConfigureOptions" + "allOf": [ + { + "$ref": "#/components/schemas/ConfigureOptions" + } + ] } - ] + } } - }, + ], "definitions": { "ConnectionUri": { "oneOf": [ @@ -346,7 +493,7 @@ expression: generated_schema_json } }, "ScalarType": { - "description": "The scalar types supported by the Engine.", + "description": "A Scalar Type.", "type": "string" }, "Nullable": { @@ -642,6 +789,202 @@ expression: generated_schema_json "type": "string" } } + }, + "Metadata2": { + "description": "Metadata information.", + "type": "object", + "properties": { + "tables": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/TablesInfo2" + } + ] + }, + "nativeQueries": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/NativeQueries2" + } + ] + }, + "aggregateFunctions": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/AggregateFunctions" + } + ] + }, + "comparisonOperators": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/ComparisonOperators" + } + ] + } + } + }, + "TablesInfo2": { + "description": "Mapping from a \"table\" name to its information.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/TableInfo2" + } + }, + "TableInfo2": { + "description": "Information about a database table (or any other kind of relation).", + "type": "object", + "required": [ + "columns", + "schemaName", + "tableName" + ], + "properties": { + "schemaName": { + "type": "string" + }, + "tableName": { + "type": "string" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ColumnInfo2" + } + }, + "uniquenessConstraints": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/UniquenessConstraints" + } + ] + }, + "foreignRelations": { + "default": {}, + "allOf": [ + { + "$ref": "#/components/schemas/ForeignRelations" + } + ] + }, + "description": { + "default": null, + "type": "string", + "nullable": true + } + } + }, + "ColumnInfo2": { + "description": "Information about a database column.", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/Type" + }, + "nullable": { + "default": "nullable", + "allOf": [ + { + "$ref": "#/components/schemas/Nullable" + } + ] + }, + "description": { + "default": null, + "type": "string", + "nullable": true + } + } + }, + "Type": { + "description": "The type of values that a column, field, or argument may take. These are either arrays or base scalar types.", + "oneOf": [ + { + "type": "object", + "required": [ + "arrayType" + ], + "properties": { + "arrayType": { + "$ref": "#/components/schemas/Type" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "scalarType" + ], + "properties": { + "scalarType": { + "$ref": "#/components/schemas/ScalarType" + } + }, + "additionalProperties": false + } + ] + }, + "NativeQueries2": { + "description": "Metadata information of native queries.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/NativeQueryInfo2" + } + }, + "NativeQueryInfo2": { + "description": "Information about a Native Query", + "type": "object", + "required": [ + "columns", + "sql" + ], + "properties": { + "sql": { + "description": "SQL expression to use for the Native Query. We can interpolate values using `{{variable_name}}` syntax, such as `SELECT * FROM authors WHERE name = {{author_name}}`", + "allOf": [ + { + "$ref": "#/components/schemas/Native_query_sql" + } + ] + }, + "columns": { + "description": "Columns returned by the Native Query", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ColumnInfo2" + } + }, + "arguments": { + "description": "Names and types of arguments that can be passed to this Native Query", + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ColumnInfo2" + } + }, + "description": { + "default": null, + "type": "string", + "nullable": true + }, + "isProcedure": { + "description": "True if this native query mutates the database", + "type": "boolean" + } + } } } } diff --git a/crates/query-engine/metadata/src/metadata/database.rs b/crates/query-engine/metadata/src/metadata/database.rs index 278cbfa22..4f7a7220f 100644 --- a/crates/query-engine/metadata/src/metadata/database.rs +++ b/crates/query-engine/metadata/src/metadata/database.rs @@ -4,7 +4,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, BTreeSet}; -/// The scalar types supported by the Engine. +/// A Scalar Type. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct ScalarType(pub String); diff --git a/crates/query-engine/metadata/src/metadata/mod.rs b/crates/query-engine/metadata/src/metadata/mod.rs index 4c6e87d05..267efb44f 100644 --- a/crates/query-engine/metadata/src/metadata/mod.rs +++ b/crates/query-engine/metadata/src/metadata/mod.rs @@ -11,7 +11,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; /// Metadata information. -#[derive(Debug, Default, Serialize, Deserialize, JsonSchema)] +#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)] #[serde(rename_all = "camelCase")] pub struct Metadata { #[serde(default)] diff --git a/crates/query-engine/translation/tests/goldenfiles/select_array_column/request.json b/crates/query-engine/translation/tests/goldenfiles/select_array_column/request.json new file mode 100644 index 000000000..2e6b02625 --- /dev/null +++ b/crates/query-engine/translation/tests/goldenfiles/select_array_column/request.json @@ -0,0 +1,23 @@ +{ + "collection": "array_series", + "query": { + "fields": { + "series": { + "type": "column", + "column": "series", + "arguments": {} + } + } + }, + "arguments": { + "from": { + "type": "literal", + "value": 1 + }, + "to": { + "type": "literal", + "value": 5 + } + }, + "collection_relationships": {} +} diff --git a/crates/query-engine/translation/tests/goldenfiles/select_array_column/tables.json b/crates/query-engine/translation/tests/goldenfiles/select_array_column/tables.json new file mode 100644 index 000000000..800e6586c --- /dev/null +++ b/crates/query-engine/translation/tests/goldenfiles/select_array_column/tables.json @@ -0,0 +1,34 @@ +{ + "nativeQueries": { + "array_series": { + "sql": "SELECT 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 + } + }, + "arguments": { + "from": { + "name": "from", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable" + }, + "to": { + "name": "to", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable" + } + }, + "description": "A native query used to test support for arrays" + } + } +} diff --git a/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/request.json b/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/request.json new file mode 100644 index 000000000..a190d2043 --- /dev/null +++ b/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/request.json @@ -0,0 +1,19 @@ +{ + "collection": "array_reverse", + "query": { + "fields": { + "reversed": { + "type": "column", + "column": "reversed", + "arguments": {} + } + } + }, + "arguments": { + "array": { + "type": "literal", + "value": ["a", "b", "c"] + } + }, + "collection_relationships": {} +} diff --git a/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/tables.json b/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/tables.json new file mode 100644 index 000000000..e38cfa791 --- /dev/null +++ b/crates/query-engine/translation/tests/goldenfiles/select_array_column_reverse/tables.json @@ -0,0 +1,32 @@ +{ + "nativeQueries": { + "array_reverse": { + "sql": "SELECT array_agg(x) as reversed FROM (SELECT x FROM unnest({{array}}) WITH ORDINALITY AS t(x,ix) ORDER BY t.ix DESC)", + "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" + } + } +} diff --git a/crates/query-engine/translation/tests/snapshots/tests__select_array_column.snap b/crates/query-engine/translation/tests/snapshots/tests__select_array_column.snap new file mode 100644 index 000000000..706c5e5b6 --- /dev/null +++ b/crates/query-engine/translation/tests/snapshots/tests__select_array_column.snap @@ -0,0 +1,34 @@ +--- +source: crates/query-engine/translation/tests/tests.rs +expression: result +--- +WITH "%1_NATIVE_QUERY_array_series" AS ( + SELECT + array_agg(arr.series) AS series + FROM + ( + SELECT + generate_series(1, 5) AS series + ) AS arr +) +SELECT + coalesce(json_agg(row_to_json("%2_universe")), '[]') AS "universe" +FROM + ( + SELECT + * + FROM + ( + SELECT + coalesce(json_agg(row_to_json("%3_rows")), '[]') AS "rows" + FROM + ( + SELECT + "%0_array_series"."series" AS "series" + FROM + "%1_NATIVE_QUERY_array_series" AS "%0_array_series" + ) AS "%3_rows" + ) AS "%3_rows" + ) AS "%2_universe" + +[] diff --git a/crates/query-engine/translation/tests/snapshots/tests__select_array_column_reverse.snap b/crates/query-engine/translation/tests/snapshots/tests__select_array_column_reverse.snap new file mode 100644 index 000000000..627b0a33d --- /dev/null +++ b/crates/query-engine/translation/tests/snapshots/tests__select_array_column_reverse.snap @@ -0,0 +1,42 @@ +--- +source: crates/query-engine/translation/tests/tests.rs +expression: result +--- +WITH "%1_NATIVE_QUERY_array_reverse" AS ( + SELECT + array_agg(x) as reversed + FROM + ( + SELECT + x + FROM + unnest( + cast( + ARRAY [cast($1 as varchar), cast($2 as varchar), cast($3 as varchar)] as varchar [] + ) + ) WITH ORDINALITY AS t(x, ix) + ORDER BY + t.ix DESC + ) +) +SELECT + coalesce(json_agg(row_to_json("%2_universe")), '[]') AS "universe" +FROM + ( + SELECT + * + FROM + ( + SELECT + coalesce(json_agg(row_to_json("%3_rows")), '[]') AS "rows" + FROM + ( + SELECT + "%0_array_reverse"."reversed" AS "reversed" + FROM + "%1_NATIVE_QUERY_array_reverse" AS "%0_array_reverse" + ) AS "%3_rows" + ) AS "%3_rows" + ) AS "%2_universe" + +[(1, String("a")), (2, String("b")), (3, String("c"))] diff --git a/crates/query-engine/translation/tests/tests.rs b/crates/query-engine/translation/tests/tests.rs index 67c12287f..707c76fa0 100644 --- a/crates/query-engine/translation/tests/tests.rs +++ b/crates/query-engine/translation/tests/tests.rs @@ -1,5 +1,17 @@ mod common; +#[test] +fn select_array_column() { + let result = common::test_translation("select_array_column").unwrap(); + insta::assert_snapshot!(result); +} + +#[test] +fn select_array_column_reverse() { + let result = common::test_translation("select_array_column_reverse").unwrap(); + insta::assert_snapshot!(result); +} + #[test] fn select_where_album_id_equals_self_nested_object_relationship() { let result = diff --git a/crates/tests/databases-tests/src/aurora/common.rs b/crates/tests/databases-tests/src/aurora/common.rs index 07841db6a..2481d92b5 100644 --- a/crates/tests/databases-tests/src/aurora/common.rs +++ b/crates/tests/databases-tests/src/aurora/common.rs @@ -2,7 +2,7 @@ use std::env; -pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/aurora/chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/aurora/v2-chinook-deployment.json"; /// We get our connection string from an env var so that it can be stored in secrets in CI pub fn get_connection_string() -> String { diff --git a/crates/tests/databases-tests/src/aurora/query_tests.rs b/crates/tests/databases-tests/src/aurora/query_tests.rs index ebc75a0fc..a44b48d90 100644 --- a/crates/tests/databases-tests/src/aurora/query_tests.rs +++ b/crates/tests/databases-tests/src/aurora/query_tests.rs @@ -15,6 +15,18 @@ mod basic { insta::assert_json_snapshot!(result); } + #[tokio::test] + async fn select_array_column_reverse() { + let result = run_query(create_router().await, "select_array_column_reverse").await; + insta::assert_json_snapshot!(result); + } + + #[tokio::test] + async fn select_array_column() { + let result = run_query(create_router().await, "select_array_column").await; + insta::assert_json_snapshot!(result); + } + #[tokio::test] async fn select_int_and_string() { let result = run_query(create_router().await, "select_int_and_string").await; diff --git a/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column.snap b/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column.snap new file mode 100644 index 000000000..acba22f78 --- /dev/null +++ b/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column.snap @@ -0,0 +1,19 @@ +--- +source: crates/tests/databases-tests/src/aurora/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "series": [ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + } +] diff --git a/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column_reverse.snap b/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column_reverse.snap new file mode 100644 index 000000000..0abcb5b7d --- /dev/null +++ b/crates/tests/databases-tests/src/aurora/snapshots/databases_tests__aurora__query_tests__basic__select_array_column_reverse.snap @@ -0,0 +1,17 @@ +--- +source: crates/tests/databases-tests/src/aurora/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "reversed": [ + "c", + "b", + "a" + ] + } + ] + } +] diff --git a/crates/tests/databases-tests/src/citus/common.rs b/crates/tests/databases-tests/src/citus/common.rs index b01032cb8..4adae20f4 100644 --- a/crates/tests/databases-tests/src/citus/common.rs +++ b/crates/tests/databases-tests/src/citus/common.rs @@ -1,6 +1,6 @@ //! Common functions used across test cases. -pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/citus/chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/citus/v2-chinook-deployment.json"; pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64004?sslmode=disable"; diff --git a/crates/tests/databases-tests/src/citus/configuration_tests.rs b/crates/tests/databases-tests/src/citus/configuration_tests.rs index c29652450..c6e372b35 100644 --- a/crates/tests/databases-tests/src/citus/configuration_tests.rs +++ b/crates/tests/databases-tests/src/citus/configuration_tests.rs @@ -9,7 +9,7 @@ mod configuration_tests { #[tokio::test] async fn test_configure_is_idempotent() { - common_tests::configuration_tests::configure_is_idempotent( + common_tests::configuration_v2_tests::configure_is_idempotent( common::CONNECTION_STRING, common::CHINOOK_DEPLOYMENT_PATH, ) @@ -18,7 +18,7 @@ mod configuration_tests { #[test] fn configuration_conforms_to_the_schema() { - common_tests::configuration_tests::configuration_conforms_to_the_schema( + common_tests::configuration_v2_tests::configuration_conforms_to_the_schema( common::CHINOOK_DEPLOYMENT_PATH, ) } diff --git a/crates/tests/databases-tests/src/citus/query_tests.rs b/crates/tests/databases-tests/src/citus/query_tests.rs index ebc75a0fc..a44b48d90 100644 --- a/crates/tests/databases-tests/src/citus/query_tests.rs +++ b/crates/tests/databases-tests/src/citus/query_tests.rs @@ -15,6 +15,18 @@ mod basic { insta::assert_json_snapshot!(result); } + #[tokio::test] + async fn select_array_column_reverse() { + let result = run_query(create_router().await, "select_array_column_reverse").await; + insta::assert_json_snapshot!(result); + } + + #[tokio::test] + async fn select_array_column() { + let result = run_query(create_router().await, "select_array_column").await; + insta::assert_json_snapshot!(result); + } + #[tokio::test] async fn select_int_and_string() { let result = run_query(create_router().await, "select_int_and_string").await; diff --git a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column.snap b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column.snap new file mode 100644 index 000000000..2b8c607d9 --- /dev/null +++ b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column.snap @@ -0,0 +1,19 @@ +--- +source: crates/tests/databases-tests/src/citus/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "series": [ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + } +] diff --git a/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column_reverse.snap b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column_reverse.snap new file mode 100644 index 000000000..5532a2fb0 --- /dev/null +++ b/crates/tests/databases-tests/src/citus/snapshots/databases_tests__citus__query_tests__basic__select_array_column_reverse.snap @@ -0,0 +1,17 @@ +--- +source: crates/tests/databases-tests/src/citus/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "reversed": [ + "c", + "b", + "a" + ] + } + ] + } +] 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 b3101159f..a2bbe22ec 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 @@ -2066,6 +2066,41 @@ expression: result } } }, + "array_reverse": { + "description": "A native query used to test support for arrays as inputs", + "fields": { + "reversed": { + "description": "The reversed array", + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + } + } + }, + "array_series": { + "description": "A native query used to test support for arrays", + "fields": { + "series": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "int4" + } + } + } + } + } + }, "artist": { "fields": { "ArtistId": { @@ -2226,6 +2261,81 @@ expression: result } } }, + "delete_playlist_track": { + "fields": { + "PlaylistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "TrackId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + } + }, + "insert_album": { + "fields": { + "AlbumId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "ArtistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "Title": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + } + }, + "insert_artist": { + "fields": { + "ArtistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "Name": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + } + }, "value_types": { "fields": { "bool": { @@ -2636,6 +2746,52 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "array_reverse", + "description": "A native query used to test support for arrays as inputs", + "arguments": { + "array": { + "description": "The array to reverse. This is necessarily of a monomorphic type.", + "type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "array_reverse", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "array_series", + "description": "A native query used to test support for arrays", + "arguments": { + "from": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "to": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "array_series", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "artist", "arguments": {}, @@ -2660,6 +2816,84 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "delete_playlist_track", + "arguments": { + "track_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "delete_playlist_track", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_album", + "arguments": { + "artist_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "title": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_album", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_artist", + "arguments": { + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "name": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_artist", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "value_types", "arguments": { diff --git a/crates/tests/databases-tests/src/cockroach/common.rs b/crates/tests/databases-tests/src/cockroach/common.rs index 0dc36d271..bedb8336f 100644 --- a/crates/tests/databases-tests/src/cockroach/common.rs +++ b/crates/tests/databases-tests/src/cockroach/common.rs @@ -1,6 +1,6 @@ //! Common functions used across test cases. -pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/cockroach/chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/cockroach/v2-chinook-deployment.json"; pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64003/defaultdb"; diff --git a/crates/tests/databases-tests/src/cockroach/configuration_tests.rs b/crates/tests/databases-tests/src/cockroach/configuration_tests.rs index c29652450..c6e372b35 100644 --- a/crates/tests/databases-tests/src/cockroach/configuration_tests.rs +++ b/crates/tests/databases-tests/src/cockroach/configuration_tests.rs @@ -9,7 +9,7 @@ mod configuration_tests { #[tokio::test] async fn test_configure_is_idempotent() { - common_tests::configuration_tests::configure_is_idempotent( + common_tests::configuration_v2_tests::configure_is_idempotent( common::CONNECTION_STRING, common::CHINOOK_DEPLOYMENT_PATH, ) @@ -18,7 +18,7 @@ mod configuration_tests { #[test] fn configuration_conforms_to_the_schema() { - common_tests::configuration_tests::configuration_conforms_to_the_schema( + common_tests::configuration_v2_tests::configuration_conforms_to_the_schema( common::CHINOOK_DEPLOYMENT_PATH, ) } diff --git a/crates/tests/databases-tests/src/cockroach/query_tests.rs b/crates/tests/databases-tests/src/cockroach/query_tests.rs index ff67f332c..2312a3869 100644 --- a/crates/tests/databases-tests/src/cockroach/query_tests.rs +++ b/crates/tests/databases-tests/src/cockroach/query_tests.rs @@ -15,6 +15,18 @@ mod basic { insta::assert_json_snapshot!(result); } + #[tokio::test] + async fn select_array_column() { + let result = run_query(create_router().await, "select_array_column").await; + insta::assert_json_snapshot!(result); + } + + #[tokio::test] + async fn select_array_column_reverse() { + let result = run_query(create_router().await, "select_array_column_reverse").await; + insta::assert_json_snapshot!(result); + } + #[tokio::test] async fn select_int_and_string() { let result = run_query(create_router().await, "select_int_and_string").await; diff --git a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column.snap b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column.snap new file mode 100644 index 000000000..c40d0025b --- /dev/null +++ b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column.snap @@ -0,0 +1,19 @@ +--- +source: crates/tests/databases-tests/src/cockroach/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "series": [ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + } +] diff --git a/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column_reverse.snap b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column_reverse.snap new file mode 100644 index 000000000..c5ae59ce8 --- /dev/null +++ b/crates/tests/databases-tests/src/cockroach/snapshots/databases_tests__cockroach__query_tests__basic__select_array_column_reverse.snap @@ -0,0 +1,17 @@ +--- +source: crates/tests/databases-tests/src/cockroach/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "reversed": [ + "c", + "b", + "a" + ] + } + ] + } +] 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 15d080a10..598c0bf6b 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 @@ -1719,6 +1719,41 @@ expression: result } } }, + "array_reverse": { + "description": "A native query used to test support for arrays as inputs", + "fields": { + "reversed": { + "description": "The reversed array", + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + } + } + }, + "array_series": { + "description": "A native query used to test support for arrays", + "fields": { + "series": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "int4" + } + } + } + } + } + }, "artist": { "fields": { "ArtistId": { @@ -1763,6 +1798,81 @@ expression: result } } }, + "delete_playlist_track": { + "fields": { + "PlaylistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "TrackId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + } + }, + "insert_album": { + "fields": { + "AlbumId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "ArtistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "Title": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + } + }, + "insert_artist": { + "fields": { + "ArtistId": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "Name": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + } + }, "pg_extension_geography_columns": { "fields": { "coord_dimension": { @@ -2360,6 +2470,52 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "array_reverse", + "description": "A native query used to test support for arrays as inputs", + "arguments": { + "array": { + "description": "The array to reverse. This is necessarily of a monomorphic type.", + "type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "array_reverse", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "array_series", + "description": "A native query used to test support for arrays", + "arguments": { + "from": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "to": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "array_series", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "artist", "arguments": {}, @@ -2384,6 +2540,84 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "delete_playlist_track", + "arguments": { + "track_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "delete_playlist_track", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_album", + "arguments": { + "artist_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "title": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_album", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_artist", + "arguments": { + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "name": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_artist", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "value_types", "arguments": { diff --git a/crates/tests/databases-tests/src/postgres/common.rs b/crates/tests/databases-tests/src/postgres/common.rs index c75f123b5..9ab3510f3 100644 --- a/crates/tests/databases-tests/src/postgres/common.rs +++ b/crates/tests/databases-tests/src/postgres/common.rs @@ -1,10 +1,11 @@ //! Common functions used across test cases. -pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/postgres/chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH_V2: &str = "static/postgres/v2-chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH_V1: &str = "static/postgres/v1-chinook-deployment.json"; pub const CONNECTION_STRING: &str = "postgresql://postgres:password@localhost:64002"; /// Creates a router with a fresh state from the test deployment. pub async fn create_router() -> axum::Router { - tests_common::router::create_router(CHINOOK_DEPLOYMENT_PATH).await + tests_common::router::create_router(CHINOOK_DEPLOYMENT_PATH_V2).await } diff --git a/crates/tests/databases-tests/src/postgres/configuration_tests.rs b/crates/tests/databases-tests/src/postgres/configuration_tests.rs index 4aeaf9e43..ea05f34ee 100644 --- a/crates/tests/databases-tests/src/postgres/configuration_tests.rs +++ b/crates/tests/databases-tests/src/postgres/configuration_tests.rs @@ -1,6 +1,12 @@ //! Tests that configuration generation has not changed. //! //! If you have changed it intentionally, run `just generate-chinook-configuration`. +//! +//! The github CI setup runs these tests subject to the filtering logic in +//! '.github/test-configuration.json'. Naming a test with the prefix 'postgres_current_only` will +//! ensure they only run on the latest version of postgres being tested. This is necessary because +//! they rely on supporting data (the chinook deployment configuration) which we maintain only for +//! the latest version. #[cfg(test)] mod configuration_tests { @@ -8,25 +14,33 @@ mod configuration_tests { use tests_common::common_tests; #[tokio::test] - async fn configure_is_idempotent() { - common_tests::configuration_tests::configure_is_idempotent( + async fn get_configuration_schema() { + let schema = schemars::schema_for!(ndc_postgres::configuration::Configuration); + insta::assert_json_snapshot!(schema); + } + + // version 2 tests + + #[tokio::test] + async fn postgres_current_only_configure_v2_is_idempotent() { + common_tests::configuration_v2_tests::configure_is_idempotent( common::CONNECTION_STRING, - common::CHINOOK_DEPLOYMENT_PATH, + common::CHINOOK_DEPLOYMENT_PATH_V2, ) .await } #[test] - fn configuration_conforms_to_the_schema() { - common_tests::configuration_tests::configuration_conforms_to_the_schema( - common::CHINOOK_DEPLOYMENT_PATH, + fn configuration_v2_conforms_to_the_schema() { + common_tests::configuration_v2_tests::configuration_conforms_to_the_schema( + common::CHINOOK_DEPLOYMENT_PATH_V2, ) } #[tokio::test] - async fn configure_initial_configuration_is_unchanged() { + async fn postgres_current_only_configure_v2_initial_configuration_is_unchanged() { let default_configuration = - common_tests::configuration_tests::configure_initial_configuration_is_unchanged( + common_tests::configuration_v2_tests::configure_initial_configuration_is_unchanged( common::CONNECTION_STRING, ) .await; @@ -35,14 +49,43 @@ mod configuration_tests { } #[tokio::test] - async fn get_rawconfiguration_schema() { - let schema = schemars::schema_for!(ndc_postgres::configuration::RawConfiguration); + async fn get_rawconfiguration_v2_schema() { + let schema = schemars::schema_for!(ndc_postgres::configuration::version2::RawConfiguration); insta::assert_json_snapshot!(schema); } + // version 1 tests + #[tokio::test] - async fn get_configuration_schema() { - let schema = schemars::schema_for!(ndc_postgres::configuration::Configuration); + async fn postgres_current_only_configure_v1_is_idempotent() { + common_tests::configuration_v1_tests::configure_is_idempotent( + common::CONNECTION_STRING, + common::CHINOOK_DEPLOYMENT_PATH_V1, + ) + .await + } + + #[test] + fn configuration_v1_conforms_to_the_schema() { + common_tests::configuration_v1_tests::configuration_conforms_to_the_schema( + common::CHINOOK_DEPLOYMENT_PATH_V1, + ) + } + + #[tokio::test] + async fn postgres_current_only_configure_v1_initial_configuration_is_unchanged() { + let default_configuration = + common_tests::configuration_v1_tests::configure_initial_configuration_is_unchanged( + common::CONNECTION_STRING, + ) + .await; + + insta::assert_json_snapshot!(default_configuration); + } + + #[tokio::test] + async fn get_rawconfiguration_v1_schema() { + let schema = schemars::schema_for!(ndc_postgres::configuration::version1::RawConfiguration); insta::assert_json_snapshot!(schema); } } diff --git a/crates/tests/databases-tests/src/postgres/mutation_tests.rs b/crates/tests/databases-tests/src/postgres/mutation_tests.rs index 6043b1670..d512df802 100644 --- a/crates/tests/databases-tests/src/postgres/mutation_tests.rs +++ b/crates/tests/databases-tests/src/postgres/mutation_tests.rs @@ -7,10 +7,12 @@ mod basic { #[tokio::test] async fn delete_playlist() { - let deployment = - create_fresh_deployment(common::CONNECTION_STRING, common::CHINOOK_DEPLOYMENT_PATH) - .await - .unwrap(); + let deployment = create_fresh_deployment( + common::CONNECTION_STRING, + common::CHINOOK_DEPLOYMENT_PATH_V2, + ) + .await + .unwrap(); let result = run_mutation( tests_common::router::create_router_from_deployment(&deployment.deployment_path).await, @@ -24,10 +26,12 @@ mod basic { #[tokio::test] async fn insert_artist_album() { - let deployment = - create_fresh_deployment(common::CONNECTION_STRING, common::CHINOOK_DEPLOYMENT_PATH) - .await - .unwrap(); + let deployment = create_fresh_deployment( + common::CONNECTION_STRING, + common::CHINOOK_DEPLOYMENT_PATH_V2, + ) + .await + .unwrap(); let result = run_mutation( tests_common::router::create_router_from_deployment(&deployment.deployment_path).await, diff --git a/crates/tests/databases-tests/src/postgres/query_tests.rs b/crates/tests/databases-tests/src/postgres/query_tests.rs index d0899495f..9c997d57a 100644 --- a/crates/tests/databases-tests/src/postgres/query_tests.rs +++ b/crates/tests/databases-tests/src/postgres/query_tests.rs @@ -15,6 +15,18 @@ mod basic { insta::assert_json_snapshot!(result); } + #[tokio::test] + async fn select_array_column() { + let result = run_query(create_router().await, "select_array_column").await; + insta::assert_json_snapshot!(result); + } + + #[tokio::test] + async fn select_array_column_reverse() { + let result = run_query(create_router().await, "select_array_column_reverse").await; + insta::assert_json_snapshot!(result); + } + #[tokio::test] async fn select_int_and_string() { let result = run_query(create_router().await, "select_int_and_string").await; diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_initial_configuration_is_unchanged.snap index fd26bbe45..1d65d633f 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_initial_configuration_is_unchanged.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_initial_configuration_is_unchanged.snap @@ -17,19 +17,25 @@ expression: default_configuration "columns": { "AlbumId": { "name": "AlbumId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": "The identifier of an album" }, "ArtistId": { "name": "ArtistId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": "The id of the artist that authored the album" }, "Title": { "name": "Title", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": "The title of an album" } @@ -56,13 +62,17 @@ expression: default_configuration "columns": { "ArtistId": { "name": "ArtistId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": "The identifier of an artist" }, "Name": { "name": "Name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": "The name of an artist" } @@ -81,79 +91,105 @@ expression: default_configuration "columns": { "Address": { "name": "Address", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "City": { "name": "City", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "Company": { "name": "Company", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "Country": { "name": "Country", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "CustomerId": { "name": "CustomerId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": "The identifier of customer" }, "Email": { "name": "Email", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "Fax": { "name": "Fax", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "FirstName": { "name": "FirstName", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": "The first name of a customer" }, "LastName": { "name": "LastName", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": "The last name of a customer" }, "Phone": { "name": "Phone", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "PostalCode": { "name": "PostalCode", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "State": { "name": "State", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "SupportRepId": { "name": "SupportRepId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null } @@ -180,91 +216,121 @@ expression: default_configuration "columns": { "Address": { "name": "Address", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "BirthDate": { "name": "BirthDate", - "type": "timestamp", + "type": { + "scalarType": "timestamp" + }, "nullable": "nullable", "description": null }, "City": { "name": "City", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "Country": { "name": "Country", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "Email": { "name": "Email", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "EmployeeId": { "name": "EmployeeId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Fax": { "name": "Fax", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "FirstName": { "name": "FirstName", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "HireDate": { "name": "HireDate", - "type": "timestamp", + "type": { + "scalarType": "timestamp" + }, "nullable": "nullable", "description": null }, "LastName": { "name": "LastName", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "Phone": { "name": "Phone", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "PostalCode": { "name": "PostalCode", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "ReportsTo": { "name": "ReportsTo", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "State": { "name": "State", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "Title": { "name": "Title", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null } @@ -291,13 +357,17 @@ expression: default_configuration "columns": { "GenreId": { "name": "GenreId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Name": { "name": "Name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null } @@ -316,55 +386,73 @@ expression: default_configuration "columns": { "BillingAddress": { "name": "BillingAddress", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "BillingCity": { "name": "BillingCity", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "BillingCountry": { "name": "BillingCountry", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "BillingPostalCode": { "name": "BillingPostalCode", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "BillingState": { "name": "BillingState", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "CustomerId": { "name": "CustomerId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "InvoiceDate": { "name": "InvoiceDate", - "type": "timestamp", + "type": { + "scalarType": "timestamp" + }, "nullable": "nonNullable", "description": null }, "InvoiceId": { "name": "InvoiceId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Total": { "name": "Total", - "type": "numeric", + "type": { + "scalarType": "numeric" + }, "nullable": "nonNullable", "description": null } @@ -391,31 +479,41 @@ expression: default_configuration "columns": { "InvoiceId": { "name": "InvoiceId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "InvoiceLineId": { "name": "InvoiceLineId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Quantity": { "name": "Quantity", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "TrackId": { "name": "TrackId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "UnitPrice": { "name": "UnitPrice", - "type": "numeric", + "type": { + "scalarType": "numeric" + }, "nullable": "nonNullable", "description": null } @@ -449,13 +547,17 @@ expression: default_configuration "columns": { "MediaTypeId": { "name": "MediaTypeId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Name": { "name": "Name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null } @@ -474,13 +576,17 @@ expression: default_configuration "columns": { "Name": { "name": "Name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "PlaylistId": { "name": "PlaylistId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null } @@ -499,13 +605,17 @@ expression: default_configuration "columns": { "PlaylistId": { "name": "PlaylistId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "TrackId": { "name": "TrackId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null } @@ -540,55 +650,73 @@ expression: default_configuration "columns": { "AlbumId": { "name": "AlbumId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "Bytes": { "name": "Bytes", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "Composer": { "name": "Composer", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "GenreId": { "name": "GenreId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "MediaTypeId": { "name": "MediaTypeId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Milliseconds": { "name": "Milliseconds", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "Name": { "name": "Name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "TrackId": { "name": "TrackId", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "UnitPrice": { "name": "UnitPrice", - "type": "numeric", + "type": { + "scalarType": "numeric" + }, "nullable": "nonNullable", "description": null } @@ -629,43 +757,57 @@ expression: default_configuration "columns": { "coord_dimension": { "name": "coord_dimension", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "f_geography_column": { "name": "f_geography_column", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "f_table_catalog": { "name": "f_table_catalog", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "f_table_name": { "name": "f_table_name", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "f_table_schema": { "name": "f_table_schema", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "srid": { "name": "srid", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "type": { "name": "type", - "type": "text", + "type": { + "scalarType": "text" + }, "nullable": "nullable", "description": null } @@ -680,43 +822,57 @@ expression: default_configuration "columns": { "coord_dimension": { "name": "coord_dimension", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "f_geometry_column": { "name": "f_geometry_column", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "f_table_catalog": { "name": "f_table_catalog", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "f_table_name": { "name": "f_table_name", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "f_table_schema": { "name": "f_table_schema", - "type": "name", + "type": { + "scalarType": "name" + }, "nullable": "nullable", "description": null }, "srid": { "name": "srid", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "type": { "name": "type", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null } @@ -731,31 +887,41 @@ expression: default_configuration "columns": { "auth_name": { "name": "auth_name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "auth_srid": { "name": "auth_srid", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "proj4text": { "name": "proj4text", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null }, "srid": { "name": "srid", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "srtext": { "name": "srtext", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nullable", "description": null } @@ -774,49 +940,65 @@ expression: default_configuration "columns": { "child_id": { "name": "child_id", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nullable", "description": null }, "feature_column": { "name": "feature_column", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "feature_type": { "name": "feature_type", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "layer_id": { "name": "layer_id", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "level": { "name": "level", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "schema_name": { "name": "schema_name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "table_name": { "name": "table_name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "topology_id": { "name": "topology_id", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null } @@ -849,31 +1031,41 @@ expression: default_configuration "columns": { "hasz": { "name": "hasz", - "type": "bool", + "type": { + "scalarType": "bool" + }, "nullable": "nonNullable", "description": null }, "id": { "name": "id", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null }, "name": { "name": "name", - "type": "varchar", + "type": { + "scalarType": "varchar" + }, "nullable": "nonNullable", "description": null }, "precision": { "name": "precision", - "type": "float8", + "type": { + "scalarType": "float8" + }, "nullable": "nonNullable", "description": null }, "srid": { "name": "srid", - "type": "int4", + "type": { + "scalarType": "int4" + }, "nullable": "nonNullable", "description": null } diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v1_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v1_initial_configuration_is_unchanged.snap new file mode 100644 index 000000000..c4d470838 --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v1_initial_configuration_is_unchanged.snap @@ -0,0 +1,1430 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: default_configuration +--- +{ + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "metadata": { + "tables": { + "Album": { + "schemaName": "public", + "tableName": "Album", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nonNullable", + "description": "The identifier of an album" + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nonNullable", + "description": "The id of the artist that authored the album" + }, + "Title": { + "name": "Title", + "type": "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": "int4", + "nullable": "nonNullable", + "description": "The identifier of an artist" + }, + "Name": { + "name": "Name", + "type": "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": "varchar", + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Company": { + "name": "Company", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": "int4", + "nullable": "nonNullable", + "description": "The identifier of customer" + }, + "Email": { + "name": "Email", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": "varchar", + "nullable": "nonNullable", + "description": "The first name of a customer" + }, + "LastName": { + "name": "LastName", + "type": "varchar", + "nullable": "nonNullable", + "description": "The last name of a customer" + }, + "Phone": { + "name": "Phone", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "SupportRepId": { + "name": "SupportRepId", + "type": "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": "varchar", + "nullable": "nullable", + "description": null + }, + "BirthDate": { + "name": "BirthDate", + "type": "timestamp", + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Email": { + "name": "Email", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "EmployeeId": { + "name": "EmployeeId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "HireDate": { + "name": "HireDate", + "type": "timestamp", + "nullable": "nullable", + "description": null + }, + "LastName": { + "name": "LastName", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "Phone": { + "name": "Phone", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "ReportsTo": { + "name": "ReportsTo", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Genre": [ + "GenreId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "Invoice": { + "schemaName": "public", + "tableName": "Invoice", + "columns": { + "BillingAddress": { + "name": "BillingAddress", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingCity": { + "name": "BillingCity", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingCountry": { + "name": "BillingCountry", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingPostalCode": { + "name": "BillingPostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingState": { + "name": "BillingState", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "InvoiceDate": { + "name": "InvoiceDate", + "type": "timestamp", + "nullable": "nonNullable", + "description": null + }, + "InvoiceId": { + "name": "InvoiceId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Total": { + "name": "Total", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "InvoiceLineId": { + "name": "InvoiceLineId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Quantity": { + "name": "Quantity", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_MediaType": [ + "MediaTypeId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "Playlist": { + "schemaName": "public", + "tableName": "Playlist", + "columns": { + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Playlist": [ + "PlaylistId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "PlaylistTrack": { + "schemaName": "public", + "tableName": "PlaylistTrack", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "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": "int4", + "nullable": "nullable", + "description": null + }, + "Bytes": { + "name": "Bytes", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Composer": { + "name": "Composer", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "GenreId": { + "name": "GenreId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "MediaTypeId": { + "name": "MediaTypeId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Milliseconds": { + "name": "Milliseconds", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": "text", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "spatial_ref_sys": { + "schemaName": "public", + "tableName": "spatial_ref_sys", + "columns": { + "auth_name": { + "name": "auth_name", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "auth_srid": { + "name": "auth_srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "proj4text": { + "name": "proj4text", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "srtext": { + "name": "srtext", + "type": "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": "int4", + "nullable": "nullable", + "description": null + }, + "feature_column": { + "name": "feature_column", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "feature_type": { + "name": "feature_type", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "layer_id": { + "name": "layer_id", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "level": { + "name": "level", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "schema_name": { + "name": "schema_name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "table_name": { + "name": "table_name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "topology_id": { + "name": "topology_id", + "type": "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": "bool", + "nullable": "nonNullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "precision": { + "name": "precision", + "type": "float8", + "nullable": "nonNullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "topology_name_key": [ + "name" + ], + "topology_pkey": [ + "id" + ] + }, + "foreignRelations": {}, + "description": null + } + }, + "nativeQueries": {}, + "aggregateFunctions": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "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" + } + }, + "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" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "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" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v2_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v2_initial_configuration_is_unchanged.snap new file mode 100644 index 000000000..1b32a3424 --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__configure_v2_initial_configuration_is_unchanged.snap @@ -0,0 +1,1622 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: default_configuration +--- +{ + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "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", + "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", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "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 + } + }, + "nativeQueries": {}, + "aggregateFunctions": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "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" + } + }, + "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" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "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" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_configuration_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_configuration_schema.snap index 9ade9367a..ebda21f57 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_configuration_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_configuration_schema.snap @@ -18,143 +18,290 @@ expression: schema "definitions": { "RawConfiguration": { "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", - "type": "object", - "required": [ - "connectionUri", - "version" - ], - "properties": { - "version": { - "type": "integer", - "format": "uint32", - "minimum": 0.0 - }, - "connectionUri": { - "$ref": "#/definitions/ConnectionUri" - }, - "poolSettings": { - "$ref": "#/definitions/PoolSettings" - }, - "metadata": { - "default": { - "tables": {}, - "nativeQueries": {}, - "aggregateFunctions": {}, - "comparisonOperators": {} - }, - "allOf": [ - { - "$ref": "#/definitions/Metadata" - } - ] - }, - "configureOptions": { - "default": { - "excludedSchemas": [ - "information_schema", - "pg_catalog", - "tiger", - "crdb_internal", - "columnar", - "columnar_internal" - ], - "unqualifiedSchemas": [ - "public" - ], - "comparisonOperatorMapping": [ - { - "operatorName": "=", - "exposedName": "_eq" - }, - { - "operatorName": "<=", - "exposedName": "_lte" - }, - { - "operatorName": ">", - "exposedName": "_gt" - }, - { - "operatorName": ">=", - "exposedName": "_gte" - }, - { - "operatorName": "<", - "exposedName": "_lt" - }, - { - "operatorName": "!=", - "exposedName": "_neq" - }, - { - "operatorName": "LIKE", - "exposedName": "_like" - }, - { - "operatorName": "NOT LIKE", - "exposedName": "_nlike" - }, - { - "operatorName": "ILIKE", - "exposedName": "_ilike" - }, - { - "operatorName": "NOT ILIKE", - "exposedName": "_nilike" - }, - { - "operatorName": "SIMILAR TO", - "exposedName": "_similar" - }, - { - "operatorName": "NOT SIMILAR TO", - "exposedName": "_nsimilar" - }, - { - "operatorName": "<>", - "exposedName": "_neq" - }, - { - "operatorName": "~~", - "exposedName": "_like" - }, - { - "operatorName": "!~~", - "exposedName": "_nlike" - }, - { - "operatorName": "~~*", - "exposedName": "_ilike" - }, - { - "operatorName": "!~~*", - "exposedName": "_nilike" + "oneOf": [ + { + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri", + "version" + ], + "properties": { + "version": { + "type": "number", + "enum": [ + "1" + ] + }, + "connectionUri": { + "$ref": "#/definitions/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/definitions/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} }, - { - "operatorName": "~", - "exposedName": "_regex" + "allOf": [ + { + "$ref": "#/definitions/Metadata" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] }, - { - "operatorName": "!~", - "exposedName": "_nregex" + "allOf": [ + { + "$ref": "#/definitions/ConfigureOptions" + } + ] + } + } + }, + { + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri", + "version" + ], + "properties": { + "version": { + "type": "string", + "enum": [ + "2" + ] + }, + "connectionUri": { + "$ref": "#/definitions/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/definitions/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} }, - { - "operatorName": "~*", - "exposedName": "_iregex" + "allOf": [ + { + "$ref": "#/definitions/Metadata2" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] }, - { - "operatorName": "!~*", - "exposedName": "_niregex" - } - ] - }, - "allOf": [ - { - "$ref": "#/definitions/ConfigureOptions" + "allOf": [ + { + "$ref": "#/definitions/ConfigureOptions" + } + ] } - ] + } } - } + ] }, "ConnectionUri": { "oneOf": [ @@ -366,7 +513,7 @@ expression: schema } }, "ScalarType": { - "description": "The scalar types supported by the Engine.", + "description": "A Scalar Type.", "type": "string" }, "Nullable": { @@ -666,6 +813,208 @@ expression: schema "type": "string" } } + }, + "Metadata2": { + "description": "Metadata information.", + "type": "object", + "properties": { + "tables": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/TablesInfo2" + } + ] + }, + "nativeQueries": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/NativeQueries2" + } + ] + }, + "aggregateFunctions": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/AggregateFunctions" + } + ] + }, + "comparisonOperators": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ComparisonOperators" + } + ] + } + } + }, + "TablesInfo2": { + "description": "Mapping from a \"table\" name to its information.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TableInfo2" + } + }, + "TableInfo2": { + "description": "Information about a database table (or any other kind of relation).", + "type": "object", + "required": [ + "columns", + "schemaName", + "tableName" + ], + "properties": { + "schemaName": { + "type": "string" + }, + "tableName": { + "type": "string" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo2" + } + }, + "uniquenessConstraints": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/UniquenessConstraints" + } + ] + }, + "foreignRelations": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ForeignRelations" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "ColumnInfo2": { + "description": "Information about a database column.", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/Type" + }, + "nullable": { + "default": "nullable", + "allOf": [ + { + "$ref": "#/definitions/Nullable" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "Type": { + "description": "The type of values that a column, field, or argument may take. These are either arrays or base scalar types.", + "oneOf": [ + { + "type": "object", + "required": [ + "arrayType" + ], + "properties": { + "arrayType": { + "$ref": "#/definitions/Type" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "scalarType" + ], + "properties": { + "scalarType": { + "$ref": "#/definitions/ScalarType" + } + }, + "additionalProperties": false + } + ] + }, + "NativeQueries2": { + "description": "Metadata information of native queries.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/NativeQueryInfo2" + } + }, + "NativeQueryInfo2": { + "description": "Information about a Native Query", + "type": "object", + "required": [ + "columns", + "sql" + ], + "properties": { + "sql": { + "description": "SQL expression to use for the Native Query. We can interpolate values using `{{variable_name}}` syntax, such as `SELECT * FROM authors WHERE name = {{author_name}}`", + "allOf": [ + { + "$ref": "#/definitions/Native_query_sql" + } + ] + }, + "columns": { + "description": "Columns returned by the Native Query", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo2" + } + }, + "arguments": { + "description": "Names and types of arguments that can be passed to this Native Query", + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo2" + } + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "isProcedure": { + "description": "True if this native query mutates the database", + "type": "boolean" + } + } } } } diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_schema.snap index 07fc68339..fb6fcc50b 100644 --- a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_schema.snap +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_schema.snap @@ -334,7 +334,7 @@ expression: schema "type": "string" }, "type": { - "$ref": "#/definitions/ScalarType" + "$ref": "#/definitions/Type" }, "nullable": { "default": "nullable", @@ -353,8 +353,37 @@ expression: schema } } }, + "Type": { + "description": "The type of values that a column, field, or argument may take. These are either arrays or base scalar types.", + "oneOf": [ + { + "type": "object", + "required": [ + "arrayType" + ], + "properties": { + "arrayType": { + "$ref": "#/definitions/Type" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "scalarType" + ], + "properties": { + "scalarType": { + "$ref": "#/definitions/ScalarType" + } + }, + "additionalProperties": false + } + ] + }, "ScalarType": { - "description": "The scalar types supported by the Engine.", + "description": "A Scalar Type.", "type": "string" }, "Nullable": { diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v1_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v1_schema.snap new file mode 100644 index 000000000..2b14f6afc --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v1_schema.snap @@ -0,0 +1,653 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: schema +--- +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawConfiguration", + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri" + ], + "properties": { + "connectionUri": { + "$ref": "#/definitions/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/definitions/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} + }, + "allOf": [ + { + "$ref": "#/definitions/Metadata" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + }, + "allOf": [ + { + "$ref": "#/definitions/ConfigureOptions" + } + ] + } + }, + "definitions": { + "ConnectionUri": { + "oneOf": [ + { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "$ref": "#/definitions/SecretValueImpl" + } + }, + "additionalProperties": false + } + ] + }, + "SecretValueImpl": { + "$id": "https://hasura.io/jsonschemas/SecretValue", + "title": "SecretValue", + "description": "Either a literal string or a reference to a Hasura secret", + "oneOf": [ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "stringValueFromSecret" + ], + "properties": { + "stringValueFromSecret": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "PoolSettings": { + "description": "Settings for the PostgreSQL connection pool", + "type": "object", + "properties": { + "maxConnections": { + "description": "maximum number of pool connections", + "default": 50, + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "poolTimeout": { + "description": "timeout for acquiring a connection from the pool (seconds)", + "default": 30, + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "idleTimeout": { + "description": "idle timeout for releasing a connection from the pool (seconds)", + "default": 180, + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "connectionLifetime": { + "description": "maximum lifetime for an individual connection (seconds)", + "default": 600, + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + } + }, + "Metadata": { + "description": "Metadata information.", + "type": "object", + "properties": { + "tables": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/TablesInfo" + } + ] + }, + "nativeQueries": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/NativeQueries" + } + ] + }, + "aggregateFunctions": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/AggregateFunctions" + } + ] + }, + "comparisonOperators": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ComparisonOperators" + } + ] + } + } + }, + "TablesInfo": { + "description": "Mapping from a \"table\" name to its information.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TableInfo" + } + }, + "TableInfo": { + "description": "Information about a database table (or any other kind of relation).", + "type": "object", + "required": [ + "columns", + "schemaName", + "tableName" + ], + "properties": { + "schemaName": { + "type": "string" + }, + "tableName": { + "type": "string" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "uniquenessConstraints": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/UniquenessConstraints" + } + ] + }, + "foreignRelations": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ForeignRelations" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "ColumnInfo": { + "description": "Information about a database column.", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/ScalarType" + }, + "nullable": { + "default": "nullable", + "allOf": [ + { + "$ref": "#/definitions/Nullable" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "ScalarType": { + "description": "A Scalar Type.", + "type": "string" + }, + "Nullable": { + "description": "Can this column contain null values", + "type": "string", + "enum": [ + "nullable", + "nonNullable" + ] + }, + "UniquenessConstraints": { + "description": "A mapping from the name of a unique constraint to its value.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UniquenessConstraint" + } + }, + "UniquenessConstraint": { + "description": "The set of columns that make up a uniqueness constraint.", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "ForeignRelations": { + "description": "A mapping from the name of a foreign key constraint to its value.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ForeignRelation" + } + }, + "ForeignRelation": { + "description": "A foreign key constraint.", + "type": "object", + "required": [ + "columnMapping", + "foreignTable" + ], + "properties": { + "foreignSchema": { + "type": [ + "string", + "null" + ] + }, + "foreignTable": { + "type": "string" + }, + "columnMapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NativeQueries": { + "description": "Metadata information of native queries.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/NativeQueryInfo" + } + }, + "NativeQueryInfo": { + "description": "Information about a Native Query", + "type": "object", + "required": [ + "columns", + "sql" + ], + "properties": { + "sql": { + "description": "SQL expression to use for the Native Query. We can interpolate values using `{{variable_name}}` syntax, such as `SELECT * FROM authors WHERE name = {{author_name}}`", + "allOf": [ + { + "$ref": "#/definitions/Native_query_sql" + } + ] + }, + "columns": { + "description": "Columns returned by the Native Query", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "arguments": { + "description": "Names and types of arguments that can be passed to this Native Query", + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "isProcedure": { + "description": "True if this native query mutates the database", + "type": "boolean" + } + } + }, + "Native_query_sql": { + "type": "string" + }, + "AggregateFunctions": { + "description": "All supported aggregate functions, grouped by type.", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AggregateFunction" + } + } + }, + "AggregateFunction": { + "type": "object", + "required": [ + "returnType" + ], + "properties": { + "returnType": { + "$ref": "#/definitions/ScalarType" + } + } + }, + "ComparisonOperators": { + "description": "The complete list of supported binary operators for scalar types. Not all of these are supported for every type.", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ComparisonOperator" + } + } + }, + "ComparisonOperator": { + "description": "Represents a postgres binary comparison operator", + "type": "object", + "required": [ + "argumentType", + "operatorName" + ], + "properties": { + "operatorName": { + "type": "string" + }, + "argumentType": { + "$ref": "#/definitions/ScalarType" + } + } + }, + "ConfigureOptions": { + "description": "Options which only influence how the configuration server updates the configuration", + "type": "object", + "properties": { + "excludedSchemas": { + "description": "Schemas which are excluded from introspection. The default setting will exclude the internal schemas of Postgres, Citus, Cockroach, and the PostGIS extension.", + "default": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "unqualifiedSchemas": { + "description": "The names of Tables and Views in these schemas will be returned unqualified. The default setting will set the `public` schema as unqualified.", + "default": [ + "public" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "comparisonOperatorMapping": { + "description": "The mapping of comparison operator names to apply when updating the configuration", + "default": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ], + "type": "array", + "items": { + "$ref": "#/definitions/ComparisonOperatorMapping" + } + } + } + }, + "ComparisonOperatorMapping": { + "description": "Define the names that comparison operators will be exposed as by the automatic introspection.", + "type": "object", + "required": [ + "exposedName", + "operatorName" + ], + "properties": { + "operatorName": { + "description": "The name of the operator as defined by the database", + "type": "string" + }, + "exposedName": { + "description": "The name the operator will appear under in the exposed API", + "type": "string" + } + } + } + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v2_schema.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v2_schema.snap new file mode 100644 index 000000000..43ebdc03d --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__get_rawconfiguration_v2_schema.snap @@ -0,0 +1,682 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: schema +--- +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RawConfiguration", + "description": "Initial configuration, just enough to connect to a database and elaborate a full 'Configuration'.", + "type": "object", + "required": [ + "connectionUri" + ], + "properties": { + "connectionUri": { + "$ref": "#/definitions/ConnectionUri" + }, + "poolSettings": { + "$ref": "#/definitions/PoolSettings" + }, + "metadata": { + "default": { + "tables": {}, + "nativeQueries": {}, + "aggregateFunctions": {}, + "comparisonOperators": {} + }, + "allOf": [ + { + "$ref": "#/definitions/Metadata" + } + ] + }, + "configureOptions": { + "default": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + }, + "allOf": [ + { + "$ref": "#/definitions/ConfigureOptions" + } + ] + } + }, + "definitions": { + "ConnectionUri": { + "oneOf": [ + { + "type": "object", + "required": [ + "uri" + ], + "properties": { + "uri": { + "$ref": "#/definitions/SecretValueImpl" + } + }, + "additionalProperties": false + } + ] + }, + "SecretValueImpl": { + "$id": "https://hasura.io/jsonschemas/SecretValue", + "title": "SecretValue", + "description": "Either a literal string or a reference to a Hasura secret", + "oneOf": [ + { + "type": "object", + "required": [ + "value" + ], + "properties": { + "value": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "stringValueFromSecret" + ], + "properties": { + "stringValueFromSecret": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "PoolSettings": { + "description": "Settings for the PostgreSQL connection pool", + "type": "object", + "properties": { + "maxConnections": { + "description": "maximum number of pool connections", + "default": 50, + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "poolTimeout": { + "description": "timeout for acquiring a connection from the pool (seconds)", + "default": 30, + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "idleTimeout": { + "description": "idle timeout for releasing a connection from the pool (seconds)", + "default": 180, + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + }, + "connectionLifetime": { + "description": "maximum lifetime for an individual connection (seconds)", + "default": 600, + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + } + }, + "Metadata": { + "description": "Metadata information.", + "type": "object", + "properties": { + "tables": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/TablesInfo" + } + ] + }, + "nativeQueries": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/NativeQueries" + } + ] + }, + "aggregateFunctions": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/AggregateFunctions" + } + ] + }, + "comparisonOperators": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ComparisonOperators" + } + ] + } + } + }, + "TablesInfo": { + "description": "Mapping from a \"table\" name to its information.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/TableInfo" + } + }, + "TableInfo": { + "description": "Information about a database table (or any other kind of relation).", + "type": "object", + "required": [ + "columns", + "schemaName", + "tableName" + ], + "properties": { + "schemaName": { + "type": "string" + }, + "tableName": { + "type": "string" + }, + "columns": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "uniquenessConstraints": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/UniquenessConstraints" + } + ] + }, + "foreignRelations": { + "default": {}, + "allOf": [ + { + "$ref": "#/definitions/ForeignRelations" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "ColumnInfo": { + "description": "Information about a database column.", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "$ref": "#/definitions/Type" + }, + "nullable": { + "default": "nullable", + "allOf": [ + { + "$ref": "#/definitions/Nullable" + } + ] + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + } + } + }, + "Type": { + "description": "The type of values that a column, field, or argument may take. These are either arrays or base scalar types.", + "oneOf": [ + { + "type": "object", + "required": [ + "arrayType" + ], + "properties": { + "arrayType": { + "$ref": "#/definitions/Type" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "scalarType" + ], + "properties": { + "scalarType": { + "$ref": "#/definitions/ScalarType" + } + }, + "additionalProperties": false + } + ] + }, + "ScalarType": { + "description": "A Scalar Type.", + "type": "string" + }, + "Nullable": { + "description": "Can this column contain null values", + "type": "string", + "enum": [ + "nullable", + "nonNullable" + ] + }, + "UniquenessConstraints": { + "description": "A mapping from the name of a unique constraint to its value.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UniquenessConstraint" + } + }, + "UniquenessConstraint": { + "description": "The set of columns that make up a uniqueness constraint.", + "type": "array", + "items": { + "type": "string" + }, + "uniqueItems": true + }, + "ForeignRelations": { + "description": "A mapping from the name of a foreign key constraint to its value.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ForeignRelation" + } + }, + "ForeignRelation": { + "description": "A foreign key constraint.", + "type": "object", + "required": [ + "columnMapping", + "foreignTable" + ], + "properties": { + "foreignSchema": { + "type": [ + "string", + "null" + ] + }, + "foreignTable": { + "type": "string" + }, + "columnMapping": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "NativeQueries": { + "description": "Metadata information of native queries.", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/NativeQueryInfo" + } + }, + "NativeQueryInfo": { + "description": "Information about a Native Query", + "type": "object", + "required": [ + "columns", + "sql" + ], + "properties": { + "sql": { + "description": "SQL expression to use for the Native Query. We can interpolate values using `{{variable_name}}` syntax, such as `SELECT * FROM authors WHERE name = {{author_name}}`", + "allOf": [ + { + "$ref": "#/definitions/Native_query_sql" + } + ] + }, + "columns": { + "description": "Columns returned by the Native Query", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "arguments": { + "description": "Names and types of arguments that can be passed to this Native Query", + "default": {}, + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ColumnInfo" + } + }, + "description": { + "default": null, + "type": [ + "string", + "null" + ] + }, + "isProcedure": { + "description": "True if this native query mutates the database", + "type": "boolean" + } + } + }, + "Native_query_sql": { + "type": "string" + }, + "AggregateFunctions": { + "description": "All supported aggregate functions, grouped by type.", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/AggregateFunction" + } + } + }, + "AggregateFunction": { + "type": "object", + "required": [ + "returnType" + ], + "properties": { + "returnType": { + "$ref": "#/definitions/ScalarType" + } + } + }, + "ComparisonOperators": { + "description": "The complete list of supported binary operators for scalar types. Not all of these are supported for every type.", + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ComparisonOperator" + } + } + }, + "ComparisonOperator": { + "description": "Represents a postgres binary comparison operator", + "type": "object", + "required": [ + "argumentType", + "operatorName" + ], + "properties": { + "operatorName": { + "type": "string" + }, + "argumentType": { + "$ref": "#/definitions/ScalarType" + } + } + }, + "ConfigureOptions": { + "description": "Options which only influence how the configuration server updates the configuration", + "type": "object", + "properties": { + "excludedSchemas": { + "description": "Schemas which are excluded from introspection. The default setting will exclude the internal schemas of Postgres, Citus, Cockroach, and the PostGIS extension.", + "default": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "unqualifiedSchemas": { + "description": "The names of Tables and Views in these schemas will be returned unqualified. The default setting will set the `public` schema as unqualified.", + "default": [ + "public" + ], + "type": "array", + "items": { + "type": "string" + } + }, + "comparisonOperatorMapping": { + "description": "The mapping of comparison operator names to apply when updating the configuration", + "default": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ], + "type": "array", + "items": { + "$ref": "#/definitions/ComparisonOperatorMapping" + } + } + } + }, + "ComparisonOperatorMapping": { + "description": "Define the names that comparison operators will be exposed as by the automatic introspection.", + "type": "object", + "required": [ + "exposedName", + "operatorName" + ], + "properties": { + "operatorName": { + "description": "The name of the operator as defined by the database", + "type": "string" + }, + "exposedName": { + "description": "The name the operator will appear under in the exposed API", + "type": "string" + } + } + } + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v1_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v1_initial_configuration_is_unchanged.snap new file mode 100644 index 000000000..c4d470838 --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v1_initial_configuration_is_unchanged.snap @@ -0,0 +1,1430 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: default_configuration +--- +{ + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "metadata": { + "tables": { + "Album": { + "schemaName": "public", + "tableName": "Album", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nonNullable", + "description": "The identifier of an album" + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nonNullable", + "description": "The id of the artist that authored the album" + }, + "Title": { + "name": "Title", + "type": "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": "int4", + "nullable": "nonNullable", + "description": "The identifier of an artist" + }, + "Name": { + "name": "Name", + "type": "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": "varchar", + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Company": { + "name": "Company", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": "int4", + "nullable": "nonNullable", + "description": "The identifier of customer" + }, + "Email": { + "name": "Email", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": "varchar", + "nullable": "nonNullable", + "description": "The first name of a customer" + }, + "LastName": { + "name": "LastName", + "type": "varchar", + "nullable": "nonNullable", + "description": "The last name of a customer" + }, + "Phone": { + "name": "Phone", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "SupportRepId": { + "name": "SupportRepId", + "type": "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": "varchar", + "nullable": "nullable", + "description": null + }, + "BirthDate": { + "name": "BirthDate", + "type": "timestamp", + "nullable": "nullable", + "description": null + }, + "City": { + "name": "City", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Country": { + "name": "Country", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Email": { + "name": "Email", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "EmployeeId": { + "name": "EmployeeId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Fax": { + "name": "Fax", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "FirstName": { + "name": "FirstName", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "HireDate": { + "name": "HireDate", + "type": "timestamp", + "nullable": "nullable", + "description": null + }, + "LastName": { + "name": "LastName", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "Phone": { + "name": "Phone", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PostalCode": { + "name": "PostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "ReportsTo": { + "name": "ReportsTo", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "State": { + "name": "State", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Genre": [ + "GenreId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "Invoice": { + "schemaName": "public", + "tableName": "Invoice", + "columns": { + "BillingAddress": { + "name": "BillingAddress", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingCity": { + "name": "BillingCity", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingCountry": { + "name": "BillingCountry", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingPostalCode": { + "name": "BillingPostalCode", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "BillingState": { + "name": "BillingState", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "CustomerId": { + "name": "CustomerId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "InvoiceDate": { + "name": "InvoiceDate", + "type": "timestamp", + "nullable": "nonNullable", + "description": null + }, + "InvoiceId": { + "name": "InvoiceId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Total": { + "name": "Total", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "InvoiceLineId": { + "name": "InvoiceLineId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Quantity": { + "name": "Quantity", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": "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": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_MediaType": [ + "MediaTypeId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "Playlist": { + "schemaName": "public", + "tableName": "Playlist", + "columns": { + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Playlist": [ + "PlaylistId" + ] + }, + "foreignRelations": {}, + "description": null + }, + "PlaylistTrack": { + "schemaName": "public", + "tableName": "PlaylistTrack", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "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": "int4", + "nullable": "nullable", + "description": null + }, + "Bytes": { + "name": "Bytes", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Composer": { + "name": "Composer", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "GenreId": { + "name": "GenreId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "MediaTypeId": { + "name": "MediaTypeId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Milliseconds": { + "name": "Milliseconds", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "UnitPrice": { + "name": "UnitPrice", + "type": "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": "text", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": "name", + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": "name", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "spatial_ref_sys": { + "schemaName": "public", + "tableName": "spatial_ref_sys", + "columns": { + "auth_name": { + "name": "auth_name", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "auth_srid": { + "name": "auth_srid", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "proj4text": { + "name": "proj4text", + "type": "varchar", + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "srtext": { + "name": "srtext", + "type": "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": "int4", + "nullable": "nullable", + "description": null + }, + "feature_column": { + "name": "feature_column", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "feature_type": { + "name": "feature_type", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "layer_id": { + "name": "layer_id", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "level": { + "name": "level", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "schema_name": { + "name": "schema_name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "table_name": { + "name": "table_name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "topology_id": { + "name": "topology_id", + "type": "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": "bool", + "nullable": "nonNullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nonNullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nonNullable", + "description": null + }, + "precision": { + "name": "precision", + "type": "float8", + "nullable": "nonNullable", + "description": null + }, + "srid": { + "name": "srid", + "type": "int4", + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "topology_name_key": [ + "name" + ], + "topology_pkey": [ + "id" + ] + }, + "foreignRelations": {}, + "description": null + } + }, + "nativeQueries": {}, + "aggregateFunctions": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "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" + } + }, + "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" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "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" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v2_initial_configuration_is_unchanged.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v2_initial_configuration_is_unchanged.snap new file mode 100644 index 000000000..1b32a3424 --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__configuration_tests__configuration_tests__postgres_current_only_configure_v2_initial_configuration_is_unchanged.snap @@ -0,0 +1,1622 @@ +--- +source: crates/tests/databases-tests/src/postgres/configuration_tests.rs +expression: default_configuration +--- +{ + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "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", + "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", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "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 + } + }, + "nativeQueries": {}, + "aggregateFunctions": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "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" + } + }, + "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" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + } + }, + "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" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": [ + "public" + ], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column.snap new file mode 100644 index 000000000..5af9d037a --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column.snap @@ -0,0 +1,19 @@ +--- +source: crates/tests/databases-tests/src/postgres/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "series": [ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + } +] diff --git a/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column_reverse.snap b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column_reverse.snap new file mode 100644 index 000000000..20a9c3407 --- /dev/null +++ b/crates/tests/databases-tests/src/postgres/snapshots/databases_tests__postgres__query_tests__basic__select_array_column_reverse.snap @@ -0,0 +1,17 @@ +--- +source: crates/tests/databases-tests/src/postgres/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "reversed": [ + "c", + "b", + "a" + ] + } + ] + } +] 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 fbd3a8316..19c69aa82 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 @@ -1984,6 +1984,41 @@ expression: result } } }, + "array_reverse": { + "description": "A native query used to test support for arrays as inputs", + "fields": { + "reversed": { + "description": "The reversed array", + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + } + } + }, + "array_series": { + "description": "A native query used to test support for arrays", + "fields": { + "series": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "array", + "element_type": { + "type": "named", + "name": "int4" + } + } + } + } + } + }, "artist": { "fields": { "ArtistId": { @@ -2841,6 +2876,52 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "array_reverse", + "description": "A native query used to test support for arrays as inputs", + "arguments": { + "array": { + "description": "The array to reverse. This is necessarily of a monomorphic type.", + "type": { + "type": "array", + "element_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "array_reverse", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "array_series", + "description": "A native query used to test support for arrays", + "arguments": { + "from": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "to": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "array_series", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "artist", "arguments": {}, @@ -2865,6 +2946,84 @@ expression: result "uniqueness_constraints": {}, "foreign_keys": {} }, + { + "name": "delete_playlist_track", + "arguments": { + "track_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + } + }, + "type": "delete_playlist_track", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_album", + "arguments": { + "artist_id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "title": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_album", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, + { + "name": "insert_artist", + "arguments": { + "id": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "int4" + } + } + }, + "name": { + "type": { + "type": "nullable", + "underlying_type": { + "type": "named", + "name": "varchar" + } + } + } + }, + "type": "insert_artist", + "uniqueness_constraints": {}, + "foreign_keys": {} + }, { "name": "value_types", "arguments": { @@ -3019,87 +3178,5 @@ expression: result } ], "functions": [], - "procedures": [ - { - "name": "delete_playlist_track", - "arguments": { - "track_id": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "int4" - } - } - } - }, - "result_type": { - "type": "named", - "name": "delete_playlist_track" - } - }, - { - "name": "insert_album", - "arguments": { - "artist_id": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "int4" - } - } - }, - "id": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "int4" - } - } - }, - "title": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "varchar" - } - } - } - }, - "result_type": { - "type": "named", - "name": "insert_album" - } - }, - { - "name": "insert_artist", - "arguments": { - "id": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "int4" - } - } - }, - "name": { - "type": { - "type": "nullable", - "underlying_type": { - "type": "named", - "name": "varchar" - } - } - } - }, - "result_type": { - "type": "named", - "name": "insert_artist" - } - } - ] + "procedures": [] } diff --git a/crates/tests/databases-tests/src/yugabyte/common.rs b/crates/tests/databases-tests/src/yugabyte/common.rs index b80366315..569d02edf 100644 --- a/crates/tests/databases-tests/src/yugabyte/common.rs +++ b/crates/tests/databases-tests/src/yugabyte/common.rs @@ -1,6 +1,6 @@ //! Common functions used across test cases. -pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/yugabyte/chinook-deployment.json"; +pub const CHINOOK_DEPLOYMENT_PATH: &str = "static/yugabyte/v2-chinook-deployment.json"; /// Creates a router with a fresh state from the test deployment. pub async fn create_router() -> axum::Router { diff --git a/crates/tests/databases-tests/src/yugabyte/query_tests.rs b/crates/tests/databases-tests/src/yugabyte/query_tests.rs index ebc75a0fc..e7ec13865 100644 --- a/crates/tests/databases-tests/src/yugabyte/query_tests.rs +++ b/crates/tests/databases-tests/src/yugabyte/query_tests.rs @@ -15,6 +15,12 @@ mod basic { insta::assert_json_snapshot!(result); } + #[tokio::test] + async fn select_array_column() { + let result = run_query(create_router().await, "select_array_column").await; + insta::assert_json_snapshot!(result); + } + #[tokio::test] async fn select_int_and_string() { let result = run_query(create_router().await, "select_int_and_string").await; diff --git a/crates/tests/databases-tests/src/yugabyte/snapshots/databases_tests__yugabyte__query_tests__basic__select_array_column.snap b/crates/tests/databases-tests/src/yugabyte/snapshots/databases_tests__yugabyte__query_tests__basic__select_array_column.snap new file mode 100644 index 000000000..cc151b64e --- /dev/null +++ b/crates/tests/databases-tests/src/yugabyte/snapshots/databases_tests__yugabyte__query_tests__basic__select_array_column.snap @@ -0,0 +1,19 @@ +--- +source: crates/tests/databases-tests/src/yugabyte/query_tests.rs +expression: result +--- +[ + { + "rows": [ + { + "series": [ + 1, + 2, + 3, + 4, + 5 + ] + } + ] + } +] diff --git a/crates/tests/tests-common/goldenfiles/select_array_column.json b/crates/tests/tests-common/goldenfiles/select_array_column.json new file mode 100644 index 000000000..2e6b02625 --- /dev/null +++ b/crates/tests/tests-common/goldenfiles/select_array_column.json @@ -0,0 +1,23 @@ +{ + "collection": "array_series", + "query": { + "fields": { + "series": { + "type": "column", + "column": "series", + "arguments": {} + } + } + }, + "arguments": { + "from": { + "type": "literal", + "value": 1 + }, + "to": { + "type": "literal", + "value": 5 + } + }, + "collection_relationships": {} +} diff --git a/crates/tests/tests-common/goldenfiles/select_array_column_reverse.json b/crates/tests/tests-common/goldenfiles/select_array_column_reverse.json new file mode 100644 index 000000000..a190d2043 --- /dev/null +++ b/crates/tests/tests-common/goldenfiles/select_array_column_reverse.json @@ -0,0 +1,19 @@ +{ + "collection": "array_reverse", + "query": { + "fields": { + "reversed": { + "type": "column", + "column": "reversed", + "arguments": {} + } + } + }, + "arguments": { + "array": { + "type": "literal", + "value": ["a", "b", "c"] + } + }, + "collection_relationships": {} +} diff --git a/crates/tests/tests-common/src/common_tests/configuration_tests.rs b/crates/tests/tests-common/src/common_tests/configuration_v1_tests.rs similarity index 58% rename from crates/tests/tests-common/src/common_tests/configuration_tests.rs rename to crates/tests/tests-common/src/common_tests/configuration_v1_tests.rs index 28fb15c15..3d817ea18 100644 --- a/crates/tests/tests-common/src/common_tests/configuration_tests.rs +++ b/crates/tests/tests-common/src/common_tests/configuration_v1_tests.rs @@ -1,15 +1,12 @@ use std::fs; use std::path::Path; -use ndc_postgres::configuration; +use ndc_postgres::configuration::version1; use similar_asserts::assert_eq; use crate::deployment::helpers::get_path_from_project_root; use crate::schemas::check_value_conforms_to_schema; -const CONFIGURATION_QUERY: &str = - include_str!("../../../../connectors/ndc-postgres/src/configuration.sql"); - // Tests that configuration generation has not changed. // // This test does not use insta snapshots because it checks the deployment file that is shared with @@ -22,14 +19,13 @@ pub async fn configure_is_idempotent( ) { let expected_value = read_configuration(chinook_deployment_path); - let mut args: configuration::RawConfiguration = serde_json::from_value(expected_value.clone()) + let mut args: version1::RawConfiguration = serde_json::from_value(expected_value.clone()) .expect("Unable to deserialize as RawConfiguration"); - args.connection_uri = configuration::ConnectionUri::Uri(configuration::ResolvedSecret( - connection_string.to_string(), - )); + args.connection_uri = + version1::ConnectionUri::Uri(version1::ResolvedSecret(connection_string.to_string())); - let actual = configuration::configure(args, CONFIGURATION_QUERY) + let actual = version1::configure(args) .await .expect("configuration::configure"); @@ -40,21 +36,21 @@ pub async fn configure_is_idempotent( pub async fn configure_initial_configuration_is_unchanged( connection_string: &str, -) -> ndc_postgres::configuration::RawConfiguration { - let args = configuration::RawConfiguration { - connection_uri: configuration::ConnectionUri::Uri(configuration::ResolvedSecret( +) -> version1::RawConfiguration { + let args = version1::RawConfiguration { + connection_uri: version1::ConnectionUri::Uri(version1::ResolvedSecret( connection_string.to_string(), )), - ..configuration::RawConfiguration::empty() + ..version1::RawConfiguration::empty() }; - configuration::configure(args, CONFIGURATION_QUERY) + version1::configure(args) .await .expect("configuration::configure") } pub fn configuration_conforms_to_the_schema(chinook_deployment_path: impl AsRef) { - check_value_conforms_to_schema::(read_configuration( + check_value_conforms_to_schema::(read_configuration( chinook_deployment_path, )); } @@ -62,5 +58,12 @@ pub fn configuration_conforms_to_the_schema(chinook_deployment_path: impl AsRef< fn read_configuration(chinook_deployment_path: impl AsRef) -> serde_json::Value { let file = fs::File::open(get_path_from_project_root(chinook_deployment_path)) .expect("fs::File::open"); - serde_json::from_reader(file).expect("serde_json::from_reader") + let mut multi_version: serde_json::Value = + serde_json::from_reader(file).expect("serde_json::from_reader"); + + // We assume the stored deployment file to be in the newest version, so to be able to make + // assertions on its serialization behavior we remove the version discriminator field. + multi_version.as_object_mut().unwrap().remove("version"); + + multi_version } diff --git a/crates/tests/tests-common/src/common_tests/configuration_v2_tests.rs b/crates/tests/tests-common/src/common_tests/configuration_v2_tests.rs new file mode 100644 index 000000000..46d423373 --- /dev/null +++ b/crates/tests/tests-common/src/common_tests/configuration_v2_tests.rs @@ -0,0 +1,69 @@ +use std::fs; +use std::path::Path; + +use ndc_postgres::configuration::version2; +use similar_asserts::assert_eq; + +use crate::deployment::helpers::get_path_from_project_root; +use crate::schemas::check_value_conforms_to_schema; + +// Tests that configuration generation has not changed. +// +// This test does not use insta snapshots because it checks the deployment file that is shared with +// other tests. +// +// If you have changed it intentionally, run `just generate-chinook-configuration`. +pub async fn configure_is_idempotent( + connection_string: &str, + chinook_deployment_path: impl AsRef, +) { + let expected_value = read_configuration(chinook_deployment_path); + + let mut args: version2::RawConfiguration = serde_json::from_value(expected_value.clone()) + .expect("Unable to deserialize as RawConfiguration"); + + args.connection_uri = + version2::ConnectionUri::Uri(version2::ResolvedSecret(connection_string.to_string())); + + let actual = version2::configure(args) + .await + .expect("configuration::configure"); + + let actual_value = serde_json::to_value(actual).expect("serde_json::to_value"); + + assert_eq!(expected_value, actual_value); +} + +pub async fn configure_initial_configuration_is_unchanged( + connection_string: &str, +) -> version2::RawConfiguration { + let args = version2::RawConfiguration { + connection_uri: version2::ConnectionUri::Uri(version2::ResolvedSecret( + connection_string.to_string(), + )), + ..version2::RawConfiguration::empty() + }; + + version2::configure(args) + .await + .expect("configuration::configure") +} + +pub fn configuration_conforms_to_the_schema(chinook_deployment_path: impl AsRef) { + check_value_conforms_to_schema::(read_configuration( + chinook_deployment_path, + )); +} + +fn read_configuration(chinook_deployment_path: impl AsRef) -> serde_json::Value { + let file = fs::File::open(get_path_from_project_root(chinook_deployment_path)) + .expect("fs::File::open"); + let mut multi_version: serde_json::Value = + serde_json::from_reader(file).expect("serde_json::from_reader"); + + // We assume the stored deployment file to be in the newest version, so to be able to make + // assertions on its serialization behavior we remove the version discriminator field. + multi_version.as_object_mut().unwrap().remove("version"); + + multi_version +} diff --git a/crates/tests/tests-common/src/common_tests/mod.rs b/crates/tests/tests-common/src/common_tests/mod.rs index 1471e000e..5e1b80e23 100644 --- a/crates/tests/tests-common/src/common_tests/mod.rs +++ b/crates/tests/tests-common/src/common_tests/mod.rs @@ -1,2 +1,3 @@ -pub mod configuration_tests; +pub mod configuration_v1_tests; +pub mod configuration_v2_tests; pub mod ndc_tests; diff --git a/crates/tests/tests-common/src/deployment/configuration.rs b/crates/tests/tests-common/src/deployment/configuration.rs index 411844f83..e39f1d30e 100644 --- a/crates/tests/tests-common/src/deployment/configuration.rs +++ b/crates/tests/tests-common/src/deployment/configuration.rs @@ -5,6 +5,7 @@ use std::fs; use std::io; use std::path::Path; +use ndc_postgres::configuration; use ndc_postgres::configuration::RawConfiguration; use super::helpers::get_path_from_project_root; @@ -19,9 +20,10 @@ pub fn copy_deployment_with_new_postgres_url( ) -> io::Result<()> { let full_path = get_path_from_project_root(main_deployment_path); - let mut new_deployment: RawConfiguration = + let new_deployment: RawConfiguration = serde_json::from_str(&fs::read_to_string(full_path).unwrap()).unwrap(); - new_deployment.connection_uri = new_connection_uri.into(); + let new_deployment = + configuration::set_connection_uri(new_deployment, new_connection_uri.into()); let new_absolute_deployment_file = fs::File::create(get_path_from_project_root(new_deployment_path))?; diff --git a/justfile b/justfile index 9d68e1212..d177b962d 100644 --- a/justfile +++ b/justfile @@ -5,20 +5,28 @@ CONNECTOR_IMAGE_TAG := "dev" CONNECTOR_IMAGE := CONNECTOR_IMAGE_NAME + ":" + CONNECTOR_IMAGE_TAG POSTGRESQL_CONNECTION_STRING := "postgresql://postgres:password@localhost:64002" -POSTGRES_CHINOOK_DEPLOYMENT := "static/postgres/chinook-deployment.json" +POSTGRES_V1_CHINOOK_DEPLOYMENT := "static/postgres/v1-chinook-deployment.json" +POSTGRES_V2_CHINOOK_DEPLOYMENT := "static/postgres/v2-chinook-deployment.json" COCKROACH_CONNECTION_STRING := "postgresql://postgres:password@localhost:64003/defaultdb" -COCKROACH_CHINOOK_DEPLOYMENT := "static/cockroach/chinook-deployment.json" +COCKROACH_V1_CHINOOK_DEPLOYMENT := "static/cockroach/v1-chinook-deployment.json" +COCKROACH_V2_CHINOOK_DEPLOYMENT := "static/cockroach/v2-chinook-deployment.json" CITUS_CONNECTION_STRING := "postgresql://postgres:password@localhost:64004?sslmode=disable" -CITUS_CHINOOK_DEPLOYMENT := "static/citus/chinook-deployment.json" +CITUS_V1_CHINOOK_DEPLOYMENT := "static/citus/v1-chinook-deployment.json" +CITUS_V2_CHINOOK_DEPLOYMENT := "static/citus/v2-chinook-deployment.json" YUGABYTE_CONNECTION_STRING := "postgresql://yugabyte@localhost:64005" -YUGABYTE_CHINOOK_DEPLOYMENT := "static/yugabyte/chinook-deployment.json" +YUGABYTE_V1_CHINOOK_DEPLOYMENT := "static/yugabyte/v1-chinook-deployment.json" +YUGABYTE_V2_CHINOOK_DEPLOYMENT := "static/yugabyte/v2-chinook-deployment.json" AURORA_CONNECTION_STRING := env_var_or_default('AURORA_CONNECTION_STRING', '') -AURORA_CHINOOK_DEPLOYMENT := "static/aurora/chinook-deployment.json" -AURORA_CHINOOK_DEPLOYMENT_TEMPLATE := "static/aurora/chinook-deployment-template.json" + +AURORA_V1_CHINOOK_DEPLOYMENT := "static/aurora/v1-chinook-deployment.json" +AURORA_V1_CHINOOK_DEPLOYMENT_TEMPLATE := "static/aurora/v1-chinook-deployment-template.json" + +AURORA_V2_CHINOOK_DEPLOYMENT := "static/aurora/v2-chinook-deployment.json" +AURORA_V2_CHINOOK_DEPLOYMENT_TEMPLATE := "static/aurora/v2-chinook-deployment-template.json" # Notes: # * Building Docker images will not work on macOS. @@ -33,7 +41,7 @@ run: start-dependencies RUST_LOG=INFO \ OTLP_ENDPOINT=http://localhost:4317 \ OTEL_SERVICE_NAME=ndc-postgres \ - cargo run --bin ndc-postgres --release -- serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log + cargo run --bin ndc-postgres --release -- serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log # run the connector run-config: start-dependencies @@ -89,7 +97,7 @@ dev: start-dependencies -c \ -x 'test -p query-engine-translation -p databases-tests --features postgres' \ -x clippy \ - -x 'run --bin ndc-postgres -- serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}}' # watch the code, then run the config server dev-config: start-dependencies @@ -110,7 +118,7 @@ dev-cockroach: start-dependencies -c \ -x 'test -p query-engine-translation -p databases-tests --features cockroach' \ -x clippy \ - -x 'run --bin ndc-postgres -- serve --configuration {{COCKROACH_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{COCKROACH_V2_CHINOOK_DEPLOYMENT}}' # watch the code, then test and re-run on changes dev-citus: start-dependencies @@ -121,7 +129,7 @@ dev-citus: start-dependencies -c \ -x 'test -p query-engine-translation -p databases-tests --features citus' \ -x clippy \ - -x 'run --bin ndc-postgres -- serve --configuration {{CITUS_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{CITUS_V2_CHINOOK_DEPLOYMENT}}' # Generate the JSON Schema document for Configuration V1. document-jsonschema: @@ -140,20 +148,20 @@ test-other-dbs: create-aurora-deployment start-dependencies -c \ -x 'test -p databases-tests --all-features' \ -x clippy \ - -x 'run --bin ndc-postgres -- serve --configuration {{AURORA_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{AURORA_V2_CHINOOK_DEPLOYMENT}}' # watch the code, and re-run on changes watch-run: start-dependencies RUST_LOG=DEBUG \ cargo watch -i "tests/snapshots/*" \ -c \ - -x 'run --bin ndc-postgres -- serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}}' + -x 'run --bin ndc-postgres -- serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}}' # Run ndc-postgres with rust-gdb. debug: start-dependencies cargo build RUST_LOG=DEBUG \ - rust-gdb --args target/debug/ndc-postgres serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}} + rust-gdb --args target/debug/ndc-postgres serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}} # Run the server and produce a flamegraph profile flamegraph: start-dependencies @@ -162,7 +170,7 @@ flamegraph: start-dependencies OTLP_ENDPOINT=http://localhost:4317 \ OTEL_SERVICE_NAME=postgres-ndc \ cargo flamegraph --bin ndc-postgres -- \ - serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log + serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log # build everything build: @@ -213,19 +221,29 @@ test *args: start-dependencies create-aurora-deployment # re-generate the deployment configuration file generate-chinook-configuration: build start-dependencies - ./scripts/archive-old-deployment.sh '{{POSTGRES_CHINOOK_DEPLOYMENT}}' - ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{POSTGRESQL_CONNECTION_STRING}}' '{{POSTGRES_CHINOOK_DEPLOYMENT}}' - ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{CITUS_CONNECTION_STRING}}' '{{CITUS_CHINOOK_DEPLOYMENT}}' - ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{COCKROACH_CONNECTION_STRING}}' '{{COCKROACH_CHINOOK_DEPLOYMENT}}' + ./scripts/archive-old-deployment.sh '{{POSTGRES_V1_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{POSTGRESQL_CONNECTION_STRING}}' '{{POSTGRES_V1_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{CITUS_CONNECTION_STRING}}' '{{CITUS_V1_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{COCKROACH_CONNECTION_STRING}}' '{{COCKROACH_V1_CHINOOK_DEPLOYMENT}}' + + ./scripts/archive-old-deployment.sh '{{POSTGRES_V2_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{POSTGRESQL_CONNECTION_STRING}}' '{{POSTGRES_V2_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{CITUS_CONNECTION_STRING}}' '{{CITUS_V2_CHINOOK_DEPLOYMENT}}' + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{COCKROACH_CONNECTION_STRING}}' '{{COCKROACH_V2_CHINOOK_DEPLOYMENT}}' + @ if [[ "$(uname -m)" == 'x86_64' ]]; then \ - echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_CHINOOK_DEPLOYMENT}}'$(tput sgr0)"; \ - ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_CHINOOK_DEPLOYMENT}}'; \ + echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_V1_CHINOOK_DEPLOYMENT}}'$(tput sgr0)"; \ + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_V1_CHINOOK_DEPLOYMENT}}'; \ + echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_V2_CHINOOK_DEPLOYMENT}}'$(tput sgr0)"; \ + ./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{YUGABYTE_CONNECTION_STRING}}' '{{YUGABYTE_V2_CHINOOK_DEPLOYMENT}}'; \ else \ echo "$(tput bold)$(tput setaf 3)WARNING:$(tput sgr0) Not updating the Yugabyte configuration because we are running on a non-x86_64 architecture."; \ fi @ if [[ -n '{{AURORA_CONNECTION_STRING}}' ]]; then \ - echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{AURORA_CONNECTION_STRING}}' '{{AURORA_CHINOOK_DEPLOYMENT_TEMPLATE}}'$(tput sgr0)"; \ - ./scripts/generate-chinook-configuration.sh "ndc-postgres" '{{AURORA_CONNECTION_STRING}}' '{{AURORA_CHINOOK_DEPLOYMENT_TEMPLATE}}'; \ + echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{AURORA_CONNECTION_STRING}}' '{{AURORA_V1_CHINOOK_DEPLOYMENT_TEMPLATE}}'$(tput sgr0)"; \ + ./scripts/generate-chinook-configuration.sh "ndc-postgres" '{{AURORA_CONNECTION_STRING}}' '{{AURORA_V1_CHINOOK_DEPLOYMENT_TEMPLATE}}'; \ + echo "$(tput bold)./scripts/generate-chinook-configuration.sh 'ndc-postgres' '{{AURORA_CONNECTION_STRING}}' '{{AURORA_V2_CHINOOK_DEPLOYMENT_TEMPLATE}}'$(tput sgr0)"; \ + ./scripts/generate-chinook-configuration.sh "ndc-postgres" '{{AURORA_CONNECTION_STRING}}' '{{AURORA_V2_CHINOOK_DEPLOYMENT_TEMPLATE}}'; \ just create-aurora-deployment; \ else \ echo "$(tput bold)$(tput setaf 3)WARNING:$(tput sgr0) Not updating the Aurora configuration because the connection string is unset."; \ @@ -250,10 +268,10 @@ start-dependencies: # injects the Aurora connection string into a deployment configuration template create-aurora-deployment: - cat {{ AURORA_CHINOOK_DEPLOYMENT_TEMPLATE }} \ + cat {{ AURORA_V2_CHINOOK_DEPLOYMENT_TEMPLATE }} \ | jq '.connectionUri.uri.value = (env | .AURORA_CONNECTION_STRING)' \ | prettier --parser=json \ - > {{ AURORA_CHINOOK_DEPLOYMENT }} + > {{ AURORA_V2_CHINOOK_DEPLOYMENT }} # run prometheus + grafana start-metrics: @@ -339,7 +357,7 @@ massif-postgres: start-dependencies OTEL_SERVICE_NAME=ndc-postgres \ valgrind --tool=massif \ target/release/ndc-postgres \ - serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log + serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log # run ndc-postgres-multitenant whilst outputting profile data for heaptrack heaptrack-postgres: start-dependencies @@ -349,7 +367,7 @@ heaptrack-postgres: start-dependencies OTEL_SERVICE_NAME=ndc-postgres \ heaptrack \ target/release/ndc-postgres \ - serve --configuration {{POSTGRES_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log + serve --configuration {{POSTGRES_V2_CHINOOK_DEPLOYMENT}} > /tmp/ndc-postgres.log # check the docker build works build-docker-with-nix: diff --git a/scripts/generate-chinook-configuration.sh b/scripts/generate-chinook-configuration.sh index 713e0c894..b9bd1f746 100755 --- a/scripts/generate-chinook-configuration.sh +++ b/scripts/generate-chinook-configuration.sh @@ -32,7 +32,7 @@ fi PRESERVED_DATA="$(jq '{"connectionUri": .connectionUri}' "$CHINOOK_DEPLOYMENT")" # Native queries should inform the initial configuration call -INITIAL_DATA="$(jq '{"poolSettings": (.poolSettings // {}), "metadata": {"nativeQueries": .metadata.nativeQueries}}' "$CHINOOK_DEPLOYMENT")" +INITIAL_DATA="$(jq '{"version": .version, "poolSettings": (.poolSettings // {}), "metadata": {"nativeQueries": .metadata.nativeQueries}}' "$CHINOOK_DEPLOYMENT")" # create a temporary file for the output so we don't overwrite data by accident NEW_FILE="$(mktemp)" diff --git a/static/aurora/.gitignore b/static/aurora/.gitignore index ea496229f..26941304c 100644 --- a/static/aurora/.gitignore +++ b/static/aurora/.gitignore @@ -1,2 +1,2 @@ # we generate this each time -chinook-deployment.json +*-deployment.json diff --git a/static/aurora/chinook-deployment-template.json b/static/aurora/v1-chinook-deployment-template.json similarity index 94% rename from static/aurora/chinook-deployment-template.json rename to static/aurora/v1-chinook-deployment-template.json index 9e1cabf14..3f69c4e6c 100644 --- a/static/aurora/chinook-deployment-template.json +++ b/static/aurora/v1-chinook-deployment-template.json @@ -687,6 +687,108 @@ }, "description": null }, + "delete_playlist_track": { + "sql": "DELETE FROM public.\"PlaylistTrack\" WHERE \"TrackId\" = {{track_id}} RETURNING *", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "track_id": { + "name": "track_id", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_album": { + "sql": "INSERT INTO public.\"Album\" VALUES({{id}}, {{title}}, {{artist_id}}) RETURNING *", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "artist_id": { + "name": "artist_id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_artist": { + "sql": "INSERT INTO public.\"Artist\" VALUES ({{id}}, {{name}}) RETURNING *", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, "value_types": { "sql": "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": { diff --git a/static/aurora/v2-chinook-deployment-template.json b/static/aurora/v2-chinook-deployment-template.json new file mode 100644 index 000000000..7ac19e59a --- /dev/null +++ b/static/aurora/v2-chinook-deployment-template.json @@ -0,0 +1,2185 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "this should be templated in by justfile" + } + }, + "poolSettings": { + "maxConnections": 1, + "poolTimeout": 600, + "idleTimeout": 180, + "connectionLifetime": 600 + }, + "metadata": { + "tables": { + "Album": { + "schemaName": "public", + "tableName": "Album", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "Album_pkey": ["AlbumId"] + }, + "foreignRelations": { + "FK_AlbumArtistId": { + "foreignSchema": "public", + "foreignTable": "Artist", + "columnMapping": { + "ArtistId": "ArtistId" + } + } + }, + "description": null + }, + "Artist": { + "schemaName": "public", + "tableName": "Artist", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "Artist_pkey": ["ArtistId"] + }, + "foreignRelations": {}, + "description": null + }, + "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": null + }, + "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": 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 + }, + "State": { + "name": "State", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "SupportRepId": { + "name": "SupportRepId", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "Customer_pkey": ["CustomerId"] + }, + "foreignRelations": { + "FK_CustomerSupportRepId": { + "foreignSchema": "public", + "foreignTable": "Employee", + "columnMapping": { + "SupportRepId": "EmployeeId" + } + } + }, + "description": null + }, + "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": { + "Employee_pkey": ["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": { + "Genre_pkey": ["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": { + "Invoice_pkey": ["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": { + "InvoiceLine_pkey": ["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": { + "MediaType_pkey": ["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": { + "Playlist_pkey": ["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": { + "Track_pkey": ["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 + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "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" + } + }, + "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": { + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "~~", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int8" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/static/citus/chinook-deployment.json b/static/citus/v1-chinook-deployment.json similarity index 94% rename from static/citus/chinook-deployment.json rename to static/citus/v1-chinook-deployment.json index 18d709a9a..e5d9543a3 100644 --- a/static/citus/chinook-deployment.json +++ b/static/citus/v1-chinook-deployment.json @@ -771,6 +771,108 @@ }, "description": null }, + "delete_playlist_track": { + "sql": "DELETE FROM public.\"PlaylistTrack\" WHERE \"TrackId\" = {{track_id}} RETURNING *", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "track_id": { + "name": "track_id", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_album": { + "sql": "INSERT INTO public.\"Album\" VALUES({{id}}, {{title}}, {{artist_id}}) RETURNING *", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "artist_id": { + "name": "artist_id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_artist": { + "sql": "INSERT INTO public.\"Artist\" VALUES ({{id}}, {{name}}) RETURNING *", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, "value_types": { "sql": "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": { diff --git a/static/citus/v2-chinook-deployment.json b/static/citus/v2-chinook-deployment.json new file mode 100644 index 000000000..051532251 --- /dev/null +++ b/static/citus/v2-chinook-deployment.json @@ -0,0 +1,2403 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64004?sslmode=disable" + } + }, + "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 + }, + "citus_schemas": { + "schemaName": "public", + "tableName": "citus_schemas", + "columns": { + "colocation_id": { + "name": "colocation_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "schema_name": { + "name": "schema_name", + "type": { + "scalarType": "regnamespace" + }, + "nullable": "nullable", + "description": null + }, + "schema_owner": { + "name": "schema_owner", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "schema_size": { + "name": "schema_size", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "citus_tables": { + "schemaName": "public", + "tableName": "citus_tables", + "columns": { + "access_method": { + "name": "access_method", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "citus_table_type": { + "name": "citus_table_type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + }, + "colocation_id": { + "name": "colocation_id", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "distribution_column": { + "name": "distribution_column", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + }, + "shard_count": { + "name": "shard_count", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "table_name": { + "name": "table_name", + "type": { + "scalarType": "regclass" + }, + "nullable": "nullable", + "description": null + }, + "table_owner": { + "name": "table_owner", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "table_size": { + "name": "table_size", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "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" + } + }, + "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": { + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "~~", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int8" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "regclass": { + "_eq": { + "operatorName": "=", + "argumentType": "regclass" + }, + "_gt": { + "operatorName": ">", + "argumentType": "regclass" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "regclass" + }, + "_lt": { + "operatorName": "<", + "argumentType": "regclass" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "regclass" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "regclass" + } + }, + "regnamespace": { + "_eq": { + "operatorName": "=", + "argumentType": "regnamespace" + }, + "_gt": { + "operatorName": ">", + "argumentType": "regnamespace" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "regnamespace" + }, + "_lt": { + "operatorName": "<", + "argumentType": "regnamespace" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "regnamespace" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "regnamespace" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/static/cockroach/chinook-deployment.json b/static/cockroach/v1-chinook-deployment.json similarity index 94% rename from static/cockroach/chinook-deployment.json rename to static/cockroach/v1-chinook-deployment.json index 9baad2aa1..70d650d17 100644 --- a/static/cockroach/chinook-deployment.json +++ b/static/cockroach/v1-chinook-deployment.json @@ -822,6 +822,108 @@ }, "description": null }, + "delete_playlist_track": { + "sql": "DELETE FROM public.\"PlaylistTrack\" WHERE \"TrackId\" = {{track_id}} RETURNING *", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "track_id": { + "name": "track_id", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_album": { + "sql": "INSERT INTO public.\"Album\" VALUES({{id}}, {{title}}, {{artist_id}}) RETURNING *", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "artist_id": { + "name": "artist_id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_artist": { + "sql": "INSERT INTO public.\"Artist\" VALUES ({{id}}, {{name}}) RETURNING *", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, "value_types": { "sql": "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": { diff --git a/static/cockroach/v2-chinook-deployment.json b/static/cockroach/v2-chinook-deployment.json new file mode 100644 index 000000000..282e0b3e8 --- /dev/null +++ b/static/cockroach/v2-chinook-deployment.json @@ -0,0 +1,2285 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64003/defaultdb" + } + }, + "metadata": { + "tables": { + "Album": { + "schemaName": "public", + "tableName": "Album", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "Title": { + "name": "Title", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Album": ["AlbumId"] + }, + "foreignRelations": { + "FK_AlbumArtistId": { + "foreignSchema": "public", + "foreignTable": "Artist", + "columnMapping": { + "ArtistId": "ArtistId" + } + } + }, + "description": null + }, + "Artist": { + "schemaName": "public", + "tableName": "Artist", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Artist": ["ArtistId"] + }, + "foreignRelations": {}, + "description": null + }, + "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": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "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": 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 + }, + "State": { + "name": "State", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "SupportRepId": { + "name": "SupportRepId", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Customer": ["CustomerId"] + }, + "foreignRelations": { + "FK_CustomerSupportRepId": { + "foreignSchema": "public", + "foreignTable": "Employee", + "columnMapping": { + "SupportRepId": "EmployeeId" + } + } + }, + "description": null + }, + "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": "int8" + }, + "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": "int8" + }, + "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": "int8" + }, + "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": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceDate": { + "name": "InvoiceDate", + "type": { + "scalarType": "timestamp" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceId": { + "name": "InvoiceId", + "type": { + "scalarType": "int8" + }, + "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": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "InvoiceLineId": { + "name": "InvoiceLineId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "Quantity": { + "name": "Quantity", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int8" + }, + "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": "int8" + }, + "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": "int8" + }, + "nullable": "nonNullable", + "description": null + } + }, + "uniquenessConstraints": { + "PK_Playlist": ["PlaylistId"] + }, + "foreignRelations": {}, + "description": null + }, + "PlaylistTrack": { + "schemaName": "public", + "tableName": "PlaylistTrack", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int8" + }, + "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": "int8" + }, + "nullable": "nullable", + "description": null + }, + "Bytes": { + "name": "Bytes", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "Composer": { + "name": "Composer", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "GenreId": { + "name": "GenreId", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "MediaTypeId": { + "name": "MediaTypeId", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "Milliseconds": { + "name": "Milliseconds", + "type": { + "scalarType": "int8" + }, + "nullable": "nonNullable", + "description": null + }, + "Name": { + "name": "Name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nonNullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": { + "scalarType": "int8" + }, + "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 + }, + "pg_extension_geography_columns": { + "schemaName": "pg_extension", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "pg_extension_geometry_columns": { + "schemaName": "pg_extension", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "pg_extension_spatial_ref_sys": { + "schemaName": "pg_extension", + "tableName": "spatial_ref_sys", + "columns": { + "auth_name": { + "name": "auth_name", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "auth_srid": { + "name": "auth_srid", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "proj4text": { + "name": "proj4text", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int8" + }, + "nullable": "nullable", + "description": null + }, + "srtext": { + "name": "srtext", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "float8": { + "avg": { + "returnType": "float8" + }, + "sqrdiff": { + "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" + } + }, + "int8": { + "avg": { + "returnType": "numeric" + }, + "bit_and": { + "returnType": "int8" + }, + "bit_or": { + "returnType": "int8" + }, + "sqrdiff": { + "returnType": "numeric" + }, + "stddev": { + "returnType": "numeric" + }, + "stddev_pop": { + "returnType": "numeric" + }, + "stddev_samp": { + "returnType": "numeric" + }, + "sum": { + "returnType": "numeric" + }, + "sum_int": { + "returnType": "int8" + }, + "var_pop": { + "returnType": "numeric" + }, + "var_samp": { + "returnType": "numeric" + }, + "variance": { + "returnType": "numeric" + }, + "xor_agg": { + "returnType": "int8" + } + }, + "numeric": { + "avg": { + "returnType": "numeric" + }, + "sqrdiff": { + "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": { + "concat_agg": { + "returnType": "text" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "ILIKE", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "LIKE", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "NOT ILIKE", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "NOT LIKE", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_nsimilar": { + "operatorName": "NOT SIMILAR TO", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + }, + "_similar": { + "operatorName": "SIMILAR TO", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "int8" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "ILIKE", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "LIKE", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "NOT ILIKE", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "NOT LIKE", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_nsimilar": { + "operatorName": "NOT SIMILAR TO", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + }, + "_similar": { + "operatorName": "SIMILAR TO", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "ILIKE", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "LIKE", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "NOT ILIKE", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "NOT LIKE", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_nsimilar": { + "operatorName": "NOT SIMILAR TO", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + }, + "_similar": { + "operatorName": "SIMILAR TO", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "ILIKE", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "LIKE", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "!=", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "NOT ILIKE", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "NOT LIKE", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_nsimilar": { + "operatorName": "NOT SIMILAR TO", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + }, + "_similar": { + "operatorName": "SIMILAR TO", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/static/deployment-snapshots/b00946c64a4ac5c73f8aab346ed7699e721af5ff4492ebbead983d76f8623c47.json b/static/deployment-snapshots/b00946c64a4ac5c73f8aab346ed7699e721af5ff4492ebbead983d76f8623c47.json new file mode 100644 index 000000000..384f2ceeb --- /dev/null +++ b/static/deployment-snapshots/b00946c64a4ac5c73f8aab346ed7699e721af5ff4492ebbead983d76f8623c47.json @@ -0,0 +1,2558 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "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", + "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", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "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 + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "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" + } + }, + "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": { + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "~~", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int8" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/static/postgres/chinook-deployment.json b/static/postgres/v1-chinook-deployment.json similarity index 100% rename from static/postgres/chinook-deployment.json rename to static/postgres/v1-chinook-deployment.json diff --git a/static/postgres/v2-chinook-deployment.json b/static/postgres/v2-chinook-deployment.json new file mode 100644 index 000000000..384f2ceeb --- /dev/null +++ b/static/postgres/v2-chinook-deployment.json @@ -0,0 +1,2558 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "postgresql://postgres:password@localhost:64002" + } + }, + "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 + }, + "geography_columns": { + "schemaName": "public", + "tableName": "geography_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geography_column": { + "name": "f_geography_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "text" + }, + "nullable": "nullable", + "description": null + } + }, + "uniquenessConstraints": {}, + "foreignRelations": {}, + "description": null + }, + "geometry_columns": { + "schemaName": "public", + "tableName": "geometry_columns", + "columns": { + "coord_dimension": { + "name": "coord_dimension", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "f_geometry_column": { + "name": "f_geometry_column", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_catalog": { + "name": "f_table_catalog", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "description": null + }, + "f_table_name": { + "name": "f_table_name", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "f_table_schema": { + "name": "f_table_schema", + "type": { + "scalarType": "name" + }, + "nullable": "nullable", + "description": null + }, + "srid": { + "name": "srid", + "type": { + "scalarType": "int4" + }, + "nullable": "nullable", + "description": null + }, + "type": { + "name": "type", + "type": { + "scalarType": "varchar" + }, + "nullable": "nullable", + "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", + "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", + "description": null + }, + "id": { + "name": "id", + "type": { + "scalarType": "int4" + }, + "nullable": "nonNullable", + "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 + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "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" + } + }, + "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": { + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "~~", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int8" + } + }, + "name": { + "_eq": { + "operatorName": "=", + "argumentType": "name" + }, + "_gt": { + "operatorName": ">", + "argumentType": "name" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "name" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "name" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "name" + }, + "_like": { + "operatorName": "~~", + "argumentType": "name" + }, + "_lt": { + "operatorName": "<", + "argumentType": "name" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "name" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "name" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "name" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "name" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "name" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "name" + }, + "_regex": { + "operatorName": "~", + "argumentType": "name" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +} diff --git a/static/yugabyte/chinook-deployment.json b/static/yugabyte/v1-chinook-deployment.json similarity index 94% rename from static/yugabyte/chinook-deployment.json rename to static/yugabyte/v1-chinook-deployment.json index 83ea124b5..2ec37f97c 100644 --- a/static/yugabyte/chinook-deployment.json +++ b/static/yugabyte/v1-chinook-deployment.json @@ -681,6 +681,108 @@ }, "description": null }, + "delete_playlist_track": { + "sql": "DELETE FROM public.\"PlaylistTrack\" WHERE \"TrackId\" = {{track_id}} RETURNING *", + "columns": { + "PlaylistId": { + "name": "PlaylistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "TrackId": { + "name": "TrackId", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "track_id": { + "name": "track_id", + "type": "int4", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_album": { + "sql": "INSERT INTO public.\"Album\" VALUES({{id}}, {{title}}, {{artist_id}}) RETURNING *", + "columns": { + "AlbumId": { + "name": "AlbumId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Title": { + "name": "Title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "artist_id": { + "name": "artist_id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "title": { + "name": "title", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, + "insert_artist": { + "sql": "INSERT INTO public.\"Artist\" VALUES ({{id}}, {{name}}) RETURNING *", + "columns": { + "ArtistId": { + "name": "ArtistId", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "Name": { + "name": "Name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "arguments": { + "id": { + "name": "id", + "type": "int4", + "nullable": "nullable", + "description": null + }, + "name": { + "name": "name", + "type": "varchar", + "nullable": "nullable", + "description": null + } + }, + "description": null + }, "value_types": { "sql": "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": { diff --git a/static/yugabyte/v2-chinook-deployment.json b/static/yugabyte/v2-chinook-deployment.json new file mode 100644 index 000000000..94870d7ab --- /dev/null +++ b/static/yugabyte/v2-chinook-deployment.json @@ -0,0 +1,2170 @@ +{ + "version": "2", + "connectionUri": { + "uri": { + "value": "postgresql://yugabyte@localhost:64005" + } + }, + "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 + } + }, + "nativeQueries": { + "album_by_title": { + "sql": "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": "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": "SELECT 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 + } + }, + "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": "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": "SELECT * FROM public.\"Artist\" WHERE \"ArtistId\" < {{id}}", + "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 + } + }, + "description": null + }, + "delete_playlist_track": { + "sql": "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 + }, + "insert_album": { + "sql": "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 + }, + "insert_artist": { + "sql": "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 + }, + "value_types": { + "sql": "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": { + "bool": { + "bool_and": { + "returnType": "bool" + }, + "bool_or": { + "returnType": "bool" + }, + "every": { + "returnType": "bool" + } + }, + "date": { + "max": { + "returnType": "date" + }, + "min": { + "returnType": "date" + } + }, + "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" + }, + "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" + }, + "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" + }, + "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" + } + }, + "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": { + "max": { + "returnType": "time" + }, + "min": { + "returnType": "time" + } + }, + "timestamp": { + "max": { + "returnType": "timestamp" + }, + "min": { + "returnType": "timestamp" + } + }, + "timestamptz": { + "max": { + "returnType": "timestamptz" + }, + "min": { + "returnType": "timestamptz" + } + }, + "timetz": { + "max": { + "returnType": "timetz" + }, + "min": { + "returnType": "timetz" + } + } + }, + "comparisonOperators": { + "bool": { + "_eq": { + "operatorName": "=", + "argumentType": "bool" + }, + "_gt": { + "operatorName": ">", + "argumentType": "bool" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "bool" + }, + "_lt": { + "operatorName": "<", + "argumentType": "bool" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "bool" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "bool" + } + }, + "char": { + "_eq": { + "operatorName": "=", + "argumentType": "char" + }, + "_gt": { + "operatorName": ">", + "argumentType": "char" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "char" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "char" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "char" + }, + "_like": { + "operatorName": "~~", + "argumentType": "char" + }, + "_lt": { + "operatorName": "<", + "argumentType": "char" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "char" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "char" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "char" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "char" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "char" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "char" + }, + "_regex": { + "operatorName": "~", + "argumentType": "char" + } + }, + "date": { + "_eq": { + "operatorName": "=", + "argumentType": "date" + }, + "_gt": { + "operatorName": ">", + "argumentType": "date" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "date" + }, + "_lt": { + "operatorName": "<", + "argumentType": "date" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "date" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "date" + } + }, + "float4": { + "_eq": { + "operatorName": "=", + "argumentType": "float4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float4" + } + }, + "float8": { + "_eq": { + "operatorName": "=", + "argumentType": "float8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "float8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "float8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "float8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "float8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "float8" + } + }, + "int2": { + "_eq": { + "operatorName": "=", + "argumentType": "int2" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int2" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int2" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int2" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int2" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int2" + } + }, + "int4": { + "_eq": { + "operatorName": "=", + "argumentType": "int4" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int4" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int4" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int4" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int4" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int4" + } + }, + "int8": { + "_eq": { + "operatorName": "=", + "argumentType": "int8" + }, + "_gt": { + "operatorName": ">", + "argumentType": "int8" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "int8" + }, + "_lt": { + "operatorName": "<", + "argumentType": "int8" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "int8" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "int8" + } + }, + "numeric": { + "_eq": { + "operatorName": "=", + "argumentType": "numeric" + }, + "_gt": { + "operatorName": ">", + "argumentType": "numeric" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "numeric" + }, + "_lt": { + "operatorName": "<", + "argumentType": "numeric" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "numeric" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "numeric" + } + }, + "text": { + "_eq": { + "operatorName": "=", + "argumentType": "text" + }, + "_gt": { + "operatorName": ">", + "argumentType": "text" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "text" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "text" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "text" + }, + "_like": { + "operatorName": "~~", + "argumentType": "text" + }, + "_lt": { + "operatorName": "<", + "argumentType": "text" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "text" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "text" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "text" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "text" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "text" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "text" + }, + "_regex": { + "operatorName": "~", + "argumentType": "text" + } + }, + "time": { + "_eq": { + "operatorName": "=", + "argumentType": "time" + }, + "_gt": { + "operatorName": ">", + "argumentType": "time" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "time" + }, + "_lt": { + "operatorName": "<", + "argumentType": "time" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "time" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "time" + } + }, + "timestamp": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamp" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamp" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamp" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamp" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamp" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamp" + } + }, + "timestamptz": { + "_eq": { + "operatorName": "=", + "argumentType": "timestamptz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timestamptz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timestamptz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timestamptz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timestamptz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timestamptz" + } + }, + "timetz": { + "_eq": { + "operatorName": "=", + "argumentType": "timetz" + }, + "_gt": { + "operatorName": ">", + "argumentType": "timetz" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "timetz" + }, + "_lt": { + "operatorName": "<", + "argumentType": "timetz" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "timetz" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "timetz" + } + }, + "uuid": { + "_eq": { + "operatorName": "=", + "argumentType": "uuid" + }, + "_gt": { + "operatorName": ">", + "argumentType": "uuid" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "uuid" + }, + "_lt": { + "operatorName": "<", + "argumentType": "uuid" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "uuid" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "uuid" + } + }, + "varchar": { + "_eq": { + "operatorName": "=", + "argumentType": "varchar" + }, + "_gt": { + "operatorName": ">", + "argumentType": "varchar" + }, + "_gte": { + "operatorName": ">=", + "argumentType": "varchar" + }, + "_ilike": { + "operatorName": "~~*", + "argumentType": "varchar" + }, + "_iregex": { + "operatorName": "~*", + "argumentType": "varchar" + }, + "_like": { + "operatorName": "~~", + "argumentType": "varchar" + }, + "_lt": { + "operatorName": "<", + "argumentType": "varchar" + }, + "_lte": { + "operatorName": "<=", + "argumentType": "varchar" + }, + "_neq": { + "operatorName": "<>", + "argumentType": "varchar" + }, + "_nilike": { + "operatorName": "!~~*", + "argumentType": "varchar" + }, + "_niregex": { + "operatorName": "!~*", + "argumentType": "varchar" + }, + "_nlike": { + "operatorName": "!~~", + "argumentType": "varchar" + }, + "_nregex": { + "operatorName": "!~", + "argumentType": "varchar" + }, + "_regex": { + "operatorName": "~", + "argumentType": "varchar" + } + } + } + }, + "configureOptions": { + "excludedSchemas": [ + "information_schema", + "pg_catalog", + "tiger", + "crdb_internal", + "columnar", + "columnar_internal" + ], + "unqualifiedSchemas": ["public"], + "comparisonOperatorMapping": [ + { + "operatorName": "=", + "exposedName": "_eq" + }, + { + "operatorName": "<=", + "exposedName": "_lte" + }, + { + "operatorName": ">", + "exposedName": "_gt" + }, + { + "operatorName": ">=", + "exposedName": "_gte" + }, + { + "operatorName": "<", + "exposedName": "_lt" + }, + { + "operatorName": "!=", + "exposedName": "_neq" + }, + { + "operatorName": "LIKE", + "exposedName": "_like" + }, + { + "operatorName": "NOT LIKE", + "exposedName": "_nlike" + }, + { + "operatorName": "ILIKE", + "exposedName": "_ilike" + }, + { + "operatorName": "NOT ILIKE", + "exposedName": "_nilike" + }, + { + "operatorName": "SIMILAR TO", + "exposedName": "_similar" + }, + { + "operatorName": "NOT SIMILAR TO", + "exposedName": "_nsimilar" + }, + { + "operatorName": "<>", + "exposedName": "_neq" + }, + { + "operatorName": "~~", + "exposedName": "_like" + }, + { + "operatorName": "!~~", + "exposedName": "_nlike" + }, + { + "operatorName": "~~*", + "exposedName": "_ilike" + }, + { + "operatorName": "!~~*", + "exposedName": "_nilike" + }, + { + "operatorName": "~", + "exposedName": "_regex" + }, + { + "operatorName": "!~", + "exposedName": "_nregex" + }, + { + "operatorName": "~*", + "exposedName": "_iregex" + }, + { + "operatorName": "!~*", + "exposedName": "_niregex" + } + ] + } +}