From da9f485fae2684d08f826dd73f1020714f0f2359 Mon Sep 17 00:00:00 2001 From: Daniel Harvey Date: Thu, 9 Nov 2023 16:50:57 +0000 Subject: [PATCH] Remove unused --- .../src/configuration/introspection.rs | 19 +++---------------- .../src/configuration/version1.rs | 4 ++-- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/crates/ndc-sqlserver/src/configuration/introspection.rs b/crates/ndc-sqlserver/src/configuration/introspection.rs index df986635..993a1b70 100644 --- a/crates/ndc-sqlserver/src/configuration/introspection.rs +++ b/crates/ndc-sqlserver/src/configuration/introspection.rs @@ -4,7 +4,6 @@ use serde::Deserialize; #[derive(Deserialize, Debug)] pub struct IntrospectionTable { pub name: String, - schema_id: i32, pub type_desc: String, pub joined_sys_schema: IntrospectionSchema, pub joined_sys_column: Vec, @@ -14,11 +13,9 @@ pub struct IntrospectionTable { #[derive(Deserialize, Debug)] pub struct IntrospectionColumn { pub name: String, - column_id: i32, pub is_nullable: bool, - is_identity: bool, - is_computed: bool, - user_type_id: i32, + pub is_identity: bool, + pub is_computed: bool, pub joined_sys_type: IntrospectionType, pub joined_foreign_key_columns: Vec, } @@ -26,14 +23,11 @@ pub struct IntrospectionColumn { #[derive(Deserialize, Debug)] pub struct IntrospectionType { pub name: String, - schema_id: i32, - user_type_id: i32, } #[derive(Deserialize, Debug)] pub struct IntrospectionPrimaryKey { pub name: String, - index_id: i32, pub columns: Vec, } @@ -44,19 +38,12 @@ pub struct IntrospectionPrimaryKeyColumn { #[derive(Deserialize, Debug)] pub struct IntrospectionForeignKeyColumn { - constraint_object_id: i32, - constraint_column_id: i32, - parent_object_id: i32, - parent_column_id: i32, - referenced_object_id: i32, - referenced_column_id: i32, pub joined_referenced_table_name: String, pub joined_referenced_column_name: String, - joined_referenced_sys_schema: IntrospectionSchema, + pub joined_referenced_sys_schema: IntrospectionSchema, } #[derive(Deserialize, Debug)] pub struct IntrospectionSchema { pub name: String, - schema_id: i32, } diff --git a/crates/ndc-sqlserver/src/configuration/version1.rs b/crates/ndc-sqlserver/src/configuration/version1.rs index ec11dbaf..a16714a1 100644 --- a/crates/ndc-sqlserver/src/configuration/version1.rs +++ b/crates/ndc-sqlserver/src/configuration/version1.rs @@ -116,13 +116,13 @@ pub async fn configure( // Nothing is fetched, the first result set starts. let row = stream.into_row().await.unwrap().unwrap(); - let inner_result = row.get(0).unwrap(); let decoded: Vec = - serde_json::from_str(inner_result).unwrap(); + serde_json::from_str(row.get(0).unwrap()).unwrap(); let mut metadata = query_engine_metadata::metadata::Metadata::default(); metadata.tables = get_tables_info(decoded); + metadata.native_queries = configuration.metadata.native_queries.clone(); Ok(RawConfiguration {