Skip to content

feat(sf_core): expose typed GetObjects metadata - #1339

Open
zeroshade wants to merge 2 commits into
snowflakedb:mainfrom
zeroshade:feat/sf-core-typed-metadata-tree
Open

feat(sf_core): expose typed GetObjects metadata#1339
zeroshade wants to merge 2 commits into
snowflakedb:mainfrom
zeroshade:feat/sf-core-typed-metadata-tree

Conversation

@zeroshade

Copy link
Copy Markdown
Contributor

Summary

  • add an owned, depth-aware GetObjects metadata tree to sf_core
  • expose DatabaseDriverV1::connection_get_objects_typed alongside the existing Arrow result-set API
  • make the existing connection_get_objects path encode its Arrow batch from the same typed tree, avoiding duplicate metadata-fetch logic
  • preserve existing catalog ordering and Arrow null/empty behavior at every GetObjects depth

API

The tree is represented by:

  • CatalogMetadata
  • DbSchemaMetadata
  • TableMetadata
  • ColumnDescriptor

Optional 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 passed
  • cargo test -p sf_core --lib — 1697 passed, 1 ignored
  • cargo check -p sf_core --all-targets
  • cargo clippy -p sf_core --lib
  • cargo doc -p sf_core --no-deps
  • cargo fmt --all -- --check
  • git diff --check

Copilot AI lite review requested due to automatic review settings August 11, 2026 21:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the database_driver_v1 module exports.
  • Introduces DatabaseDriverV1::connection_get_objects_typed and refactors the legacy Arrow connection_get_objects to 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.

Comment thread sf_core/src/apis/database_driver_v1/get_objects.rs
Comment thread sf_core/src/apis/database_driver_v1/get_objects.rs Outdated
Copilot AI review requested due to automatic review settings August 11, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 None child collection means the requested depth stopped at its parent”, but only CatalogMetadata::db_schemas and DbSchemaMetadata::tables are optional. TableMetadata::columns is always a Vec, so callers can’t interpret None/Some(Vec::new()) semantics for columns from this documentation as written. Please clarify that the None/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants