Open
Description
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_]*".
Activity
toptobes commentedon 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!