Skip to content

Feat: Register non-spatial GeoPackage tables in gpkg_contents - #600

Draft
adrien-berchet with Copilot wants to merge 2 commits into
mainfrom
copilot/add-non-spatial-tables-support
Draft

adrien-berchet with Copilot wants to merge 2 commits into
mainfrom
copilot/add-non-spatial-tables-support

Conversation

Copilot AI commented Apr 13, 2026

Copy link
Copy Markdown

Description

GeoPackage consumers expect all tables (including non-spatial) to be discoverable via gpkg_contents; currently only spatial tables are registered. This PR adds spec-aligned handling for non-spatial tables so they are created as attributes entries and removed cleanly on drop.

  • Dialect behavior updates

    • after_create now inserts a gpkg_contents row for tables without geometry columns:
      • data_type = 'attributes'
      • srs_id = 0
    • before_drop now removes the corresponding gpkg_contents row for non-spatial tables.
  • Focused regression coverage

    • Added unit tests for GeoPackage admin hooks to verify:
      • non-spatial table registration on create
      • non-spatial table cleanup on drop
if not is_spatial:
    bind.execute(
        text(
            """INSERT INTO gpkg_contents VALUES (
                :table_name, 'attributes', :table_name, "",
                strftime('%Y-%m-%dT%H:%M:%fZ', CURRENT_TIMESTAMP),
                NULL, NULL, NULL, NULL, 0
            );"""
        ).bindparams(table_name=table.name)
    )

Checklist

This pull request is:

  • A documentation / typographical error fix
    • Good to go, no issue or tests are needed
  • A short code fix
    • Please include tests that fail with the main branch and pass with the provided fix.
  • A new feature implementation or update an existing feature
    • Please include tests that cover every lines of the new/updated feature.
    • Please update the documentation to describe the new/updated feature.

Copilot AI changed the title [WIP] Add support for non-spatial tables in Geopackages Feat: Register non-spatial GeoPackage tables in gpkg_contents Apr 13, 2026
Copilot AI requested a review from adrien-berchet April 13, 2026 10:15
Copilot AI and others added 2 commits July 7, 2026 22:33
Agent-Logs-Url: https://github.com/geoalchemy/geoalchemy2/sessions/f5b8a299-1de5-4fce-9881-d3a8fb9b51ad

Co-authored-by: adrien-berchet <11536226+adrien-berchet@users.noreply.github.com>
Agent-Logs-Url: https://github.com/geoalchemy/geoalchemy2/sessions/f5b8a299-1de5-4fce-9881-d3a8fb9b51ad

Co-authored-by: adrien-berchet <11536226+adrien-berchet@users.noreply.github.com>
@adrien-berchet
adrien-berchet force-pushed the copilot/add-non-spatial-tables-support branch from 95e63ed to fc3323c Compare July 7, 2026 20:33
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.

[Feature request] Support non-spatial tables in Geopackages according to the specification

2 participants