Repository navigation
refactor: PostgresCatalogSettings, simpler pg_get_collection_index and backend-specific geometry literal hooks - #313
Merged
Conversation
…kend Add Collection._tag_geometry_literal / _reproject_geometry_literal hooks (defaulting to the PostGIS ST_SetSRID / ST_Transform calls used today) and move _quote_ident to tipg.collections so other backends can reuse them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collection._tag_geometry_literal / _reproject_geometry_literal no longer default to PostGIS functions: each backend must define them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lify pg_get_collection_index - tipg.pg.settings.DatabaseSettings → PostgresCatalogSettings (same TIPG_DB_ prefix) - pg_get_collection_index(*, connection_pool, settings=None) acquires its own connection - tipg.main.register_collection_catalog takes a required catalog_settings - update docs, notebook (+ IPython/jupyter/folium dev deps) and tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Claude Code made this PR under the supervision of vincentsarago.
These changes were split out of #307 (DuckDB backend) so that PR only contains the DuckDB code. #307 is stacked on this branch.
Changes
DatabaseSettings→PostgresCatalogSettings(tipg.pg.settings, re-exported fromtipg.pg). It keeps theTIPG_DB_env prefix, so existing environment variables still work.pg_get_collection_index(*, connection_pool, settings=None): it now acquires a connection from the pool itself, so callers no longer needasync with pool.acquire() as conn.tipg.main.register_collection_catalog(app, catalog_settings):catalog_settingsis now required and replaces thedb_settingsoption.Collection._tag_geometry_literal/_reproject_geometry_literalare new abstract methods. They define how CQL2 / bbox / tile geometry literals get the geometry column CRS.PgCollectionimplements them with the sameST_SetSRID/ST_Transformcalls as before, so the generated SQL is unchanged. This lets other backends (feat: add DuckDB backend #307) use their own functions._quote_identmoved fromtipg.pg.collectionstotipg.collections.customization.md,ogc_features_server.mdandogc_tiles_server.mdand the class paths inconfiguration.mdare updated;docs/src/api/tipg/pg/*.mdpages now point to the right modules (they all renderedtipg.collections).examples/non_app_usage.ipynbis updated for the newtipg.pgAPI (addsIPython,jupyterandfoliumto the dev dependencies).Breaking changes (listed in CHANGES.md)
DatabaseSettingsrename, thepg_get_collection_indexsignature, theregister_collection_catalogsignature, and the new abstract methods that customCollectionsubclasses must implement.Testing
pre-commit run --all-filespasses.mypy -p tipg --ignore-missing-imports(CI command) passes.🤖 Generated with Claude Code