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

[gpkg] Implement relationship creation, deletion and update support #6823

Merged
merged 1 commit into from Dec 2, 2022

Conversation

nyalldawson
Copy link
Collaborator

Relationships can only be updated to change their base or related table fields, or the relationship related table type. It is not permissible to change the base or related table itself, or the mapping table details. If this is desired then a new relationship should be created instead.

autotest/ogr/ogr_gpkg.py Outdated Show resolved Hide resolved
autotest/ogr/ogr_gpkg.py Outdated Show resolved Hide resolved
ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp Outdated Show resolved Hide resolved
ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp Outdated Show resolved Hide resolved
ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp Outdated Show resolved Hide resolved
ogr/ogrsf_frmts/gpkg/ogrgeopackagedatasource.cpp Outdated Show resolved Hide resolved
@rouault
Copy link
Member

rouault commented Nov 30, 2022

you may need to rebase on latest master, to get a fix that makes sure ASAN tests are based. Given that the "alpine" CI config fails with a hard crash, there might be some memory error somewhere. It could also come from a bad use of the API in Python, which can sometimes lead to crashes (like you work on a layer after destroying the dataset, or releasing it with ReleaseResultSet)

@nyalldawson
Copy link
Collaborator Author

@rouault

It could also come from a bad use of the API in Pytho

Got it -- I was reusing relationships which had been passed to UpdateRelationship, which takes ownership

@nyalldawson
Copy link
Collaborator Author

This will need squashing before merge, but I've left atomic commits here for review

@rouault rouault added this to the 3.7.0 milestone Dec 1, 2022
@rouault
Copy link
Member

rouault commented Dec 1, 2022

For the linting issues, do you have pre-commit set up for your GDAL git checkout ? Cf https://gdal.org/development/dev_practices.html#commit-hooks . Once setup, git commit will re-format things automatically. It might be a bit surprising the first time, as it will return an error, but do the reformatting. You need to run git commit a second time, which will succeed then.

Relationships can only be updated to change their base or related
table fields, or the relationship related table type. It is not
permissible to change the base or related table itself, or the mapping
table details. If this is desired then a new relationship should be
created instead.
@nyalldawson
Copy link
Collaborator Author

For the linting issues, do you have pre-commit set up for your GDAL git checkout

I do now 😆

@rouault rouault merged commit 8d100a8 into OSGeo:master Dec 2, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants