Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Nov 9, 2023
1 parent c67c177 commit da9f485
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
19 changes: 3 additions & 16 deletions crates/ndc-sqlserver/src/configuration/introspection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IntrospectionColumn>,
Expand All @@ -14,26 +13,21 @@ 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<IntrospectionForeignKeyColumn>,
}

#[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<IntrospectionPrimaryKeyColumn>,
}

Expand All @@ -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,
}
4 changes: 2 additions & 2 deletions crates/ndc-sqlserver/src/configuration/version1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<introspection::IntrospectionTable> =
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 {
Expand Down

0 comments on commit da9f485

Please sign in to comment.