feat(sf_core): expose typed GetObjects metadata - #1339
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a typed, owned GetObjects metadata tree in sf_core and adds a new DatabaseDriverV1::connection_get_objects_typed API, while refactoring the existing connection_get_objects Arrow result-set path to reuse the same underlying metadata-fetching logic to avoid duplication and preserve existing ordering/null/empty semantics.
Changes:
- Adds typed metadata tree structs (
CatalogMetadata,DbSchemaMetadata,TableMetadata) and exposes them via thedatabase_driver_v1module exports. - Introduces
DatabaseDriverV1::connection_get_objects_typedand refactors the legacy Arrowconnection_get_objectsto build batches from the typed tree. - Adds unit tests validating ordering and null/empty behavior when converting typed metadata to Arrow batches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sf_core/src/apis/database_driver_v1/mod.rs |
Re-exports new typed metadata structs so they’re available to API consumers. |
sf_core/src/apis/database_driver_v1/get_objects.rs |
Implements typed metadata tree, new typed API entrypoint, refactors Arrow path to reuse typed tree, and adds tests for behavioral parity. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
sf_core/src/apis/database_driver_v1/get_objects.rs:240
- The doc comment here says “A
Nonechild collection means the requested depth stopped at its parent”, but onlyCatalogMetadata::db_schemasandDbSchemaMetadata::tablesare optional.TableMetadata::columnsis always aVec, so callers can’t interpretNone/Some(Vec::new())semantics for columns from this documentation as written. Please clarify that theNone/empty distinction applies to the optional child vectors only.
/// Unlike [`Self::connection_get_objects`], this API does not encode the
/// metadata into an Arrow result-set handle. A `None` child collection
/// means the requested depth stopped at its parent; `Some(Vec::new())`
/// means that level was requested but matched no objects.
Summary
sf_coreDatabaseDriverV1::connection_get_objects_typedalongside the existing Arrow result-set APIconnection_get_objectspath encode its Arrow batch from the same typed tree, avoiding duplicate metadata-fetch logicAPI
The tree is represented by:
CatalogMetadataDbSchemaMetadataTableMetadataColumnDescriptorOptional child vectors distinguish a depth cutoff (
None) from a requested level with no matches (Some(Vec::new())).Testing
cargo test -p sf_core --lib get_objects::tests— 41 passedcargo test -p sf_core --lib— 1697 passed, 1 ignoredcargo check -p sf_core --all-targetscargo clippy -p sf_core --libcargo doc -p sf_core --no-depscargo fmt --all -- --checkgit diff --check