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

Dataset ignore my primary key #414

Open
ahvahsky2008 opened this issue Mar 2, 2023 · 3 comments
Open

Dataset ignore my primary key #414

ahvahsky2008 opened this issue Mar 2, 2023 · 3 comments

Comments

@ahvahsky2008
Copy link

Why dataset ignore my key? I wanna that acategory_id will be primary key, but it creates own pk (id field)

payload = {'acategory_id': 1, 'acategory_name': 'xxx'}
db['axixa'].upsert(payload, keys=['acategory_id'])

image

@pudo
Copy link
Owner

pudo commented Mar 3, 2023

I think you can just specify the primary key column you want to use via get_table: https://dataset.readthedocs.io/en/latest/api.html#dataset.Database.get_table

@ahvahsky2008
Copy link
Author

I guess why pudo doesn't create my pk

@pudo
Copy link
Owner

pudo commented Mar 3, 2023

??

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

No branches or pull requests

2 participants