Skip to content

feat: allow API endpoint URLs to be used as database references#291

Open
erichare wants to merge 1 commit intodatastax:mainfrom
erichare:feat-api-endpoint
Open

feat: allow API endpoint URLs to be used as database references#291
erichare wants to merge 1 commit intodatastax:mainfrom
erichare:feat-api-endpoint

Conversation

@erichare
Copy link
Collaborator

Parses the database UUID from Astra endpoint URLs of the form:
https://-.apps.astra*.datastax.com[/...]

No change to existing internals - DbRef.parse() now checks for an HTTP(S) URL first, extracts the 36-char UUID prefix from the hostname if present, and falls through to the existing UUID/name logic otherwise.

Closes #289

Parses the database UUID from Astra endpoint URLs of the form:
  https://<uuid>-<region>.apps.astra*.datastax.com[/...]

No change to existing internals - DbRef.parse() now checks for an
HTTP(S) URL first, extracts the 36-char UUID prefix from the hostname
if present, and falls through to the existing UUID/name logic otherwise.

Closes datastax#289

Co-Authored-By: Oz <oz-agent@warp.dev>
@erichare erichare closed this Mar 10, 2026
@erichare erichare reopened this Mar 10, 2026
@toptobes
Copy link
Collaborator

toptobes commented Mar 19, 2026

Thanks for the PR! Just to let you know though astra-db-java actually already provides the functionality for parsing the ID from the endpoint

Also I was planning on adding a "preferred region" functionality since the endpoint may contain a region too

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.

[FEAT] Allow an API endpoint to be used as a database reference

2 participants