Skip to content

feat(info): show driver docs URL in dbc info - #511

Open
djfrancesco wants to merge 1 commit into
columnar-tech:mainfrom
djfrancesco:feat/info-docs-url
Open

djfrancesco wants to merge 1 commit into
columnar-tech:mainfrom
djfrancesco:feat/info-docs-url

Conversation

@djfrancesco

Copy link
Copy Markdown

Closes #499

Summary

dbc docs already uses the docs_url from the registry index, but dbc info never showed it. This PR adds it to both the plaintext and the JSON output.

In plaintext, there's a new Docs: line after Description:. It only shows up when the driver has a docs URL:

$ dbc info snowflake
Driver: snowflake
Version: 1.14.0
Title: ASF Snowflake Driver
License: Apache-2.0
Description: An ADBC driver for Snowflake developed under the Apache Software Foundation
Docs: https://adbc-drivers.org/drivers/snowflake/
Available Packages:
   - linux_amd64
   ...

With --json, the driver.info payload gets a docs_url field:

{"schema_version":1,"kind":"driver.info","payload":{"driver":"snowflake", ..., "description":"...","docs_url":"https://adbc-drivers.org/drivers/snowflake/","packages":[...]}}

A few choices I made

I went with Docs: as the label since it's short and matches dbc docs. Drivers without a docs URL get no line at all, so their output doesn't change.

In the JSON, docs_url is always there (empty string when unset). I left out omitempty on purpose, so it behaves like title, license and description right next to it. The field is new, so schema_version stays at 1.

Easy to change any of these if you'd prefer something else.

The tests reuse the existing test-driver-docs-url fixture, and also check that a driver without a docs URL gets no Docs: line and an empty docs_url.

Not in this PR

dbc search -v --json doesn't include docs_url either. I can do that in a follow-up if you want it.

Test plan

  • go test ./... passes with Go 1.26.8 (env and user levels)
  • New tests fail without the change and pass with it
  • go vet ./... clean; changed files are gofmt-clean
  • Manual: dbc info snowflake and dbc info snowflake --json against the default registry show the docs URL

Display the registry's docs_url for a driver in `dbc info` output:
a "Docs:" line in plaintext (only when set) and a docs_url field in
the --json payload (always present, empty when unset).

Closes columnar-tech#499

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dbc docs url to dbc info

1 participant