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

Error on keyspaces starting with a number #1814

Open
toptobes opened this issue Jan 1, 2025 · 1 comment
Open

Error on keyspaces starting with a number #1814

toptobes opened this issue Jan 1, 2025 · 1 comment
Assignees
Labels
Bug Something isn't working Feature - Tables Issue impacts the users of Tables To-Do

Comments

@toptobes
Copy link

toptobes commented Jan 1, 2025

Got an issue from someone reporting that the Data API does not accept otherwise perfectly valid keyspaces which start with a number, such as 2DQJAUtSzzzKP9buDTvUvPk3. I can confirm that such a keyspace can be created from the portal with absolutely no issues.

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_]*".

datastax/astra-db-ts#94

@Hazel-Datastax
Copy link
Contributor

Similar to #1674, will solve them together

@amorton amorton added Bug Something isn't working Feature - Tables Issue impacts the users of Tables To-Do labels Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Feature - Tables Issue impacts the users of Tables To-Do
Projects
None yet
Development

No branches or pull requests

3 participants