Skip to content

Datastore upsert update not working with index _id #6793

@digital-codes

Description

@digital-codes

CKAN version 2.9.5

Describe the bug
A clear and concise description of what the bug is.
datastore/upsert method=update does not work with _id

Steps to reproduce
Steps to reproduce the behavior:
Create resource in datastore
insert values
read values => resulting records have unique field _id, as expected
update command with _id fails on "undefined primary_key"
{
"error": {
"__type": "Validation Error",
"table": [
"table does not have a unique key defined"
]
},

Expected behavior
A clear and concise description of what you expected to happen.
Record number _id can be used as primary key, as in regular SQL database

Additional details
If possible, please provide the full stack trace of the error raised, or add screenshots to help explain your problem.

Use case: update resource with timeseries data which by design do not come with an inherent primary key. So primary key must be database id. However, this cannot be enforced on datastore_create()

Maybe you consider this not a bug - but we have an id in the data, so not allowing to use it is quite close ...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions