Skip to content

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

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

adrien-berchet with Copilot wants to merge 4 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
@adrien-berchet
adrien-berchet force-pushed the copilot/add-non-spatial-tables-support branch from 95e63ed to fc3323c Compare July 7, 2026 20:33
Copilot AI and others added 3 commits November 4, 2026 19:47
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>
Non-spatial tables created with the GeoPackage dialect are now registered in gpkg_contents with
data_type='attributes' and srs_id=NULL (GeoPackage spec, Requirement 118). Only tables with a single
INTEGER primary key acting as a rowid alias are registered (Requirement 119), so tables like
alembic_version, WITHOUT ROWID tables and temporary tables are left unregistered.

The registration is skipped when the GeoPackage base tables do not exist yet, and works in Alembic
offline mode. Alembic table renames (including batch mode) keep the gpkg_contents row in sync.
@adrien-berchet
adrien-berchet force-pushed the copilot/add-non-spatial-tables-support branch from fc3323c to 89c4b73 Compare November 4, 2026 19:56
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T22:10:10.561178Z
We couldn’t complete this review. Comment @codex review to try again.
7ba64c9 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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