fix(graphile-postgis): detect PostGIS when only geography codecs are present#935
Merged
pyramation merged 1 commit intomainfrom Mar 30, 2026
Merged
Conversation
…present Previously, PostgisExtensionDetectionPlugin required a geometry codec to detect PostGIS. Databases that use only geography columns (e.g. all DataPostGIS nodes with use_geography: true) would not have a geometry codec introspected, causing PostGIS detection to silently fail and geography columns to be omitted from the GraphQL schema with warnings: Do not know how to convert PgCodec 'geography' into a GraphQL type Changes: - detect-extension.ts: Accept either geometry OR geography codec - detect-extension.ts: Extract schemaName from geography codec when geometry is absent - types.ts: Make geometryCodec nullable (PgCodec | null) - connection-filter-operators.ts: Handle null geometryCodec in codec pairs - within-distance-operator.ts: Handle null geometryCodec in codec pairs
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
PostgisExtensionDetectionPluginpreviously required ageometrycodec to detect PostGIS. Databases that exclusively usegeographycolumns (e.g. allDataPostGISnodes withuse_geography: true, as in agentic-db) never have ageometrycodec introspected, so PostGIS detection silently failed. This produced warnings like:Root cause: The detection guard was
if (!geometryCodec) return build— now changed toif (!geometryCodec && !geographyCodec) return build.Changes across 4 files:
types.ts:geometryCodecis nowPgCodec | null(wasPgCodec), symmetric withgeographyCodecdetect-extension.ts: Accept either codec for detection; extractschemaNamefrom geography codec when geometry is absentconnection-filter-operators.ts/within-distance-operator.ts: Conditionally pushgeometryCodecinto codec pairs only when non-null (matches existinggeographyCodecpattern)Review & Testing Checklist for Human
PostgisExtensionInfo.geometryCodecoutside this package assume it is non-null. The type changed fromPgCodectoPgCodec | null— the build passes across the monorepo, but confirm no external packages depend on it being non-null at runtime.register-types.tsline 97 — it already filters nulls via.filter((c): c is PgCodec => c !== null), but confirm this is the only place that iterates over both codecs.location_geofields appear in the GraphQL schema.Notes
detect-extension.test.tsif desired.Link to Devin session: https://app.devin.ai/sessions/6dd1a19fd02948fda1fee04c955f4bf2
Requested by: @pyramation