We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug If you import a tabular dataset with the --primary-key option, it's possible to use a field that isn't actually unique.
--primary-key
Kart doesn't check, and any duplicate rows silently overwrite each other during import.
To Reproduce
sqlite3 bad-pks.sqlite
create table mydataset (badpk integer, sometext text); insert into mydataset (badpk, sometext) values (1, 'text1'); insert into mydataset (badpk, sometext) values (1, 'text2');
kart init myrepo ; cd myrepo
kart import --primary-key=badpk OGR:../bad-pks.sqlite
kart show -- mydataset:feature
Expected behaviour
An error should be raised since the badpk field has two duplicate values
badpk
Output
The dataset is imported and only one of the features survives
$ kart show -- mydataset:feature commit d2439097269d5dccd73aaec4d0fd388e6e9aa669 Author: Craig de Stigter <craig@destigter.nz> Date: Fri Jun 23 10:21:11 2023 +1200 Import from bad-pks.sqlite:mydataset to mydataset/ +++ mydataset:feature:1 + badpk = 1 + sometext = text2
**Version Info **
The text was updated successfully, but these errors were encountered:
Duplicate of #307 ?
Sorry, something went wrong.
No branches or pull requests
Describe the bug
If you import a tabular dataset with the
--primary-key
option, it's possible to use a field that isn't actually unique.Kart doesn't check, and any duplicate rows silently overwrite each other during import.
To Reproduce
sqlite3 bad-pks.sqlite
kart init myrepo ; cd myrepo
kart import --primary-key=badpk OGR:../bad-pks.sqlite
kart show -- mydataset:feature
Expected behaviour
An error should be raised since the
badpk
field has two duplicate valuesOutput
The dataset is imported and only one of the features survives
**Version Info **
The text was updated successfully, but these errors were encountered: