-
Notifications
You must be signed in to change notification settings - Fork 7
Support complex & array types in native query creation cli utility #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
042e727
dc7fb6b
b4aa1d2
d9b9b6a
96005c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,40 +225,35 @@ pub async fn oids_to_typenames( | |
|
|
||
| // Reverse lookup the schema.typename and find the ndc type name, | ||
| // if we find all we can just add the nq and call it a day. | ||
| for row in rows { | ||
| 'rows: for row in rows { | ||
| let schema_name: String = row.schema_name; | ||
| let type_name: String = row.type_name; | ||
| let oid: i64 = row.oid; | ||
|
|
||
| let mut found = false; | ||
| for (scalar_type_name, info) in &configuration.metadata.types.scalar.0 { | ||
| if info.schema_name == schema_name && info.type_name == type_name { | ||
| oids_map.insert(oid, scalar_type_name.inner().clone()); | ||
| found = true; | ||
| continue; | ||
|
||
| continue 'rows; | ||
| } | ||
| } | ||
| for (composite_type_name, info) in &configuration.metadata.types.composite.0 { | ||
| if info.schema_name == schema_name && info.type_name == type_name { | ||
| oids_map.insert(oid, composite_type_name.clone()); | ||
| found = true; | ||
| continue; | ||
| continue 'rows; | ||
| } | ||
| } | ||
|
|
||
| // If we don't find it we generate a name which is either schema_typename | ||
| // or just typename depending if the schema is in the unqualified list or not, | ||
| // then add the nq and run the introspection. | ||
| if !found { | ||
| if configuration | ||
| .introspection_options | ||
| .unqualified_schemas_for_types_and_procedures | ||
| .contains(&schema_name) | ||
| { | ||
| oids_map.insert(oid, type_name.into()); | ||
| } else { | ||
| oids_map.insert(oid, format!("{schema_name}_{type_name}").into()); | ||
| } | ||
| if configuration | ||
| .introspection_options | ||
| .unqualified_schemas_for_types_and_procedures | ||
| .contains(&schema_name) | ||
| { | ||
| oids_map.insert(oid, type_name.into()); | ||
| } else { | ||
| oids_map.insert(oid, format!("{schema_name}_{type_name}").into()); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section was missing, and since v4 does have composite types I think this was a mistake