Skip to content
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

Keyspace creation vs Keyspace Retrieval Regex #94

Open
roybarber opened this issue Dec 28, 2024 · 1 comment
Open

Keyspace creation vs Keyspace Retrieval Regex #94

roybarber opened this issue Dec 28, 2024 · 1 comment
Labels
Data API issue Issue arises from the Data API, not the client

Comments

@roybarber
Copy link

I'm able to create a Keyspace both via REST API and Admin area with the value "2DQJAUtSzzzKP9buDTvUvPk3" but unable to retrieve and use it via the REST api.

const dbAdmin = admin.dbAdmin(dbEndpoint)
await dbAdmin.createKeyspace('2DQJAUtSzzzKP9buDTvUvPk3')

// then i can list: 
const keyspaces = await dbAdmin.listKeyspaces()
console.log(keyspaces)

{
  "existingKeyspaces": [
    "default_keyspace",
    "2DQJAUtSzzzKP9buDTvUvPk3"
  ]
}

Then when trying to use the keyspace:

const collectionNames = await db.listCollections({ nameOnly: true, keyspace: '2DQJAUtSzzzKP9buDTvUvPk3' })
// or 
await db.createCollection('collectionname', { keyspace: '2DQJAUtSzzzKP9buDTvUvPk3' })

This returns:

DataAPIResponseError: Request invalid: field 'keyspace' value "2DQJAUtSzzzKP9buDTvUvPk3" not valid. Problem: must match "[a-zA-Z][a-zA-Z0-9_]*".

@toptobes
Copy link
Collaborator

toptobes commented Jan 1, 2025

Hi Roy, thanks for finding this out.

This is not an actually issue with the client, but with the Data API itself; I think the ability to create a keyspace starting with a number is relatively new, because I don't recall that being possible before, but I may be misremembering.

Nevertheless, I'll pass it onto the team on your behalf, and keep you updated. Thank you!

@toptobes toptobes added the Data API issue Issue arises from the Data API, not the client label Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data API issue Issue arises from the Data API, not the client
Projects
None yet
Development

No branches or pull requests

2 participants