feat: add @pgpm/ltree-helpers — slash/ltree/lquery path conversion#64
Merged
pyramation merged 2 commits intomainfrom May 5, 2026
Merged
feat: add @pgpm/ltree-helpers — slash/ltree/lquery path conversion#64pyramation merged 2 commits intomainfrom
pyramation merged 2 commits intomainfrom
Conversation
New @pgpm/ltree-helpers package with ltree_helpers schema containing: - ltree_helpers.to_path(text) -> ltree: slash path to ltree - ltree_helpers.to_slash(ltree) -> text: ltree to slash path - ltree_helpers.to_query(text) -> lquery: glob to lquery Includes deploy/verify/revert scripts, tests, and compiled SQL.
🤖 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:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Matches jwt-claims/stamps pattern — functions called from RLS policies need to be accessible to authenticated and anonymous roles.
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
New
@pgpm/ltree-helperspackage inpackages/ltree-helpers/with its ownltree_helpersschema. Provides threeIMMUTABLE STRICTSQL functions for converting between user-facing slash paths and PostgreSQL ltree/lquery types:ltree_helpers.to_path(text) -> ltree'/projects/alpha/docs'->'projects.alpha.docs'ltree_helpers.to_slash(ltree) -> text'projects.alpha.docs'->'/projects/alpha/docs'ltree_helpers.to_query(text) -> lquery'/projects/*/docs'->'projects.*.docs'These support the file access system in constructive-db (Phase 2b). The storage module generator will use these to create computed
foldercolumns on files tables, keeping ltree as an internal implementation detail while exposing familiar slash-path APIs.Includes tests covering basic conversions, edge cases, and roundtrip verification.
Review & Testing Checklist for Human
ltree_helpersschema name is acceptableNotes
Companion PRs:
constructive.controldependencypgpm-ltree-helpersto system modules array andPGPM_MODULE_MAPLink to Devin session: https://app.devin.ai/sessions/ffa3ed8652fc412f976accbdc229c88d
Requested by: @pyramation