Skip to content

fix(orm): use compact alias names when transforming ORM queries to Kysely#2406

Merged
ymc9 merged 3 commits intodevfrom
fix/issue-2378
Feb 25, 2026
Merged

fix(orm): use compact alias names when transforming ORM queries to Kysely#2406
ymc9 merged 3 commits intodevfrom
fix/issue-2378

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Feb 25, 2026

fixes #2378

Summary by CodeRabbit

  • Bug Fixes

    • Improved SQL alias generation to avoid collisions and length issues in complex nested queries.
  • New Features

    • Added a configurable option to enable compact/normalized alias names (defaults enabled).
  • Tests

    • Added a regression test covering deep nested includes to ensure alias compliance.
  • Documentation

    • Added a testing guideline entry for placing regression tests for reported issues.

@claude
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude finished @ymc9's task —— View job


PR Review: Compact Alias Names for Kysely Transformation

Reviewing PR #2406 which fixes issue #2378 by implementing compact alias names when transforming ORM queries to Kysely.

Review Checklist:

Review Feedback

Overall Assessment: LOOKS GOOD

This is a well-implemented solution to a PostgreSQL identifier length limitation issue. The approach is clean, efficient, and properly tested.


Problem Analysis

Issue #2378 occurs when deep nested includes generate alias names exceeding PostgreSQL's 63-byte identifier limit. The test case demonstrates a 5-level deep include:

RepositoryCases -> Templates -> TemplateCaseAssignment -> CaseFields -> CaseFieldAssignment -> FieldOptions

Previously, aliases like $$_{parentAlias}$template$caseFields$caseField$fieldOptions could exceed this limit.


Implementation Review

🔧 Core Solution: TempAliasTransformer (temp-alias-transformer.ts:1-28)

  • Excellent approach: Uses Kysely's built-in OperationNodeTransformer pattern
  • Smart mapping strategy: Maps long aliases like $$_complex_nested_name to compact forms like $t1, $t2
  • Consistency guarantee: Same temp alias always maps to the same short name within a query
  • Proper isolation: Clears alias map per query execution

🎯 Integration in Executor (zenstack-query-executor.ts:635-640)

  • Proper placement: Applied in processTempAlias() after name mapping but before query execution
  • Configurable: Controlled by useCompactAliasNames option (defaults to true)
  • Good performance: Only runs when needed

⚙️ Configuration (options.ts:202-205)

  • Well documented: Clear description of the feature
  • Sensible default: useCompactAliasNames defaults to true
  • Proper typing: Boolean flag with clear intent

Code Quality Assessment

✅ Strengths:

  1. Focused solution: Addresses the exact problem without over-engineering
  2. Consistent patterns: Follows existing codebase conventions using Kysely transformers
  3. Backward compatibility: Can be disabled if needed via configuration
  4. Comprehensive test: Regression test covers the exact failure scenario
  5. Minimal changes: Only touches what's necessary, reducing risk

✅ Security & Performance:

  • No security concerns: Simple string transformation with no user input
  • Excellent performance: O(n) complexity where n is number of unique aliases
  • Memory efficient: Uses simple Map for small number of aliases per query
  • No SQL injection risk: Works at AST level, not string manipulation

✅ Test Coverage:

  • Complete scenario: Tests the exact 5-level nesting that caused the original issue
  • Proper validation: Verifies both query execution and result structure
  • Real-world case: Uses realistic domain model relationships

Minor Observations

  1. Constants change in base.ts: The change from 'exists' to '$exists' appears unrelated to this fix but follows the same compact naming convention.

  2. No edge case testing: While the core test is comprehensive, could benefit from:

    • Testing with disabled useCompactAliasNames option
    • Verifying behavior with very long nested chains (8+ levels)
  3. Documentation: Could add a code comment explaining the 63-byte PostgreSQL limit context in the transformer.


Recommendation: ✅ APPROVE

This PR effectively solves the PostgreSQL identifier length limitation with a clean, performant solution. The implementation follows good software engineering practices and includes proper testing.

Suggested minor improvements:

  • Add a brief comment in TempAliasTransformer about the PostgreSQL 63-byte limit context
  • Consider adding a test case with useCompactAliasNames: false to verify the option works

Overall, this is a solid fix that should resolve issue #2378 without introducing regressions.


@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40f4671 and aacb82d.

📒 Files selected for processing (7)
  • packages/orm/src/client/crud/dialects/mysql.ts
  • packages/orm/src/client/crud/dialects/postgresql.ts
  • packages/orm/src/client/crud/dialects/sqlite.ts
  • packages/orm/src/client/crud/operations/base.ts
  • packages/orm/src/client/executor/temp-alias-transformer.ts
  • packages/plugins/policy/src/expression-transformer.ts
  • packages/plugins/policy/src/policy-handler.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/orm/src/client/executor/temp-alias-transformer.ts
  • packages/orm/src/client/crud/dialects/sqlite.ts

📝 Walkthrough

Walkthrough

Introduces a temporary-alias system: adds TEMP_ALIAS_PREFIX and tmpAlias(), wraps generated SQL aliases across dialects, adds TempAliasTransformer to compact prefixed aliases before execution, adds ClientOptions.useCompactAliasNames flag, updates several internal aliases and exists-result naming, and adds a regression test for deep nested includes.

Changes

Cohort / File(s) Summary
Core Alias Utilities
packages/orm/src/client/query-utils.ts
Add TEMP_ALIAS_PREFIX and tmpAlias(name) to mark/normalize temporary aliases.
Alias Transformer & Executor
packages/orm/src/client/executor/temp-alias-transformer.ts, packages/orm/src/client/executor/zenstack-query-executor.ts
Add TempAliasTransformer to map TEMP_ALIAS_PREFIX names to compact aliases; integrate it into query processing pipeline and conditionally apply based on option.
Client Configuration
packages/orm/src/client/options.ts
Add useCompactAliasNames?: boolean to ClientOptions<Schema> (controls whether compact aliasing is applied; documented default true).
Dialect & CRUD Alias Updates
packages/orm/src/client/crud/dialects/base-dialect.ts, packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts, packages/orm/src/client/crud/dialects/sqlite.ts, packages/orm/src/client/crud/dialects/mysql.ts, packages/orm/src/client/crud/dialects/postgresql.ts
Replace many hard-coded/generated alias strings with tmpAlias(...) calls; change some internal selection aliases (e.g., JSON/EXISTS subquery aliases) from '$t' to '_'.
Query Operations
packages/orm/src/client/crud/operations/base.ts
Change exists-check result alias from exists to $exists and adjust returned access to match.
Policy & Plugin Changes
packages/plugins/policy/src/expression-transformer.ts, packages/plugins/policy/src/policy-handler.ts
Adjust internal aliasing in predicates/subqueries from '$t' to '_' for intermediate selections.
Tests & Docs
tests/regression/test/issue-2378.test.ts, CLAUDE.md
Add regression test for deep nested include alias length and add testing guideline about regression test file placement.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibbled long alias vines so sly,
Wrapped them in a tiny, tidy dye,
$$_names turned short — a hopping feat,
No more truncation, fields all neat,
Rabbit cheers: deep queries now fly! 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: using compact alias names to fix ORM queries transformation.
Linked Issues check ✅ Passed Changes comprehensively address issue #2378 by implementing compact alias generation to prevent PostgreSQL identifier truncation collisions.
Out of Scope Changes check ✅ Passed All changes relate to compact alias name generation for the fix, including the regression test validating the 63-byte limit requirement.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/issue-2378

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/orm/src/client/executor/zenstack-query-executor.ts (2)

635-640: Creating a new TempAliasTransformer instance per query is correct — document the concurrency rationale.

The new TempAliasTransformer() per call avoids concurrent queries on the same executor racing over a shared aliasMap. Given that run() already clears the map (making the class reuse-safe), a future reader might be tempted to hoist this to an instance field as an "optimization". A brief inline comment would prevent that regression.

💬 Suggested comment
 private processTempAlias<Node extends RootOperationNode>(query: Node): Node {
     if (this.options.useCompactAliasNames === false) {
         return query;
     }
-    return new TempAliasTransformer().run(query);
+    // A new instance is created per call intentionally: TempAliasTransformer holds
+    // per-query state (aliasMap) and a shared instance would race under concurrent queries.
+    return new TempAliasTransformer().run(query);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/orm/src/client/executor/zenstack-query-executor.ts` around lines 635
- 640, Add an inline comment in processTempAlias explaining why we instantiate a
new TempAliasTransformer per call: this avoids concurrent queries sharing a
single transformer/aliasMap and racing; although TempAliasTransformer.run clears
its map (making reuse technically safe), do not hoist it to an executor field as
an "optimization" because that would reintroduce potential concurrency
bugs—refer to processTempAlias and TempAliasTransformer.run/aliasMap in the
comment so future readers understand the rationale.

635-640: new TempAliasTransformer() per call is the correct concurrency choice — document it.

A future reader might hoist this to a private instance field as a "trivial" optimization (since run() resets state). That would introduce a data race under concurrent queries sharing the same executor. A brief comment prevents the regression.

💬 Suggested inline comment
 private processTempAlias<Node extends RootOperationNode>(query: Node): Node {
     if (this.options.useCompactAliasNames === false) {
         return query;
     }
-    return new TempAliasTransformer().run(query);
+    // New instance per call: TempAliasTransformer holds per-query mutable state (aliasMap).
+    // Do NOT hoist to a shared field — concurrent queries on the same executor would race.
+    return new TempAliasTransformer().run(query);
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/orm/src/client/executor/zenstack-query-executor.ts` around lines 635
- 640, Add a short inline comment in processTempAlias explaining why we
instantiate a new TempAliasTransformer for each call (instead of hoisting it to
a private field): TempAliasTransformer.run() holds/resettable internal state so
reusing one instance across concurrent queries would cause a data race;
therefore keep "new TempAliasTransformer().run(query)" when
options.useCompactAliasNames is true to preserve thread-safety/concurrency.
Reference processTempAlias, TempAliasTransformer, run, and
options.useCompactAliasNames in the comment so future maintainers understand the
rationale.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/orm/src/client/executor/temp-alias-transformer.ts`:
- Around line 16-26: The compact alias generator in transformIdentifier uses
plain `$tN` which can collide with user/dialect aliases; update the mapping so
mapped names use a more distinctive, collision-resistant prefix (e.g. `$$t` or
`_zt`) instead of `$t` and centralize that prefix as a constant (referencing
TEMP_ALIAS_PREFIX, aliasMap, transformIdentifier, and IdentifierNode.create) so
creation of mapped = `<NEW_PREFIX>${this.aliasMap.size + 1}` replaces the
current `$t` scheme; ensure the constant is well-named and used wherever compact
aliases are produced to avoid silent collisions with user-provided identifiers.
- Around line 19-23: The compact temp-alias generation risks colliding with real
aliases named like "$t1"; update the alias generation in
temp-alias-transformer.ts so mapped uses a distinctive prefix (e.g. "$$t")
instead of "$t" by deriving the name from the existing TEMP_ALIAS_PREFIX or
hardcoding a "$$t" prefix, continue to increment with this prefix plus
(this.aliasMap.size + 1), set this.aliasMap.set(node.name, mapped) as before,
and return IdentifierNode.create(mapped) so temp aliases are unlikely to collide
with user or dialect-generated identifiers.

---

Nitpick comments:
In `@packages/orm/src/client/executor/zenstack-query-executor.ts`:
- Around line 635-640: Add an inline comment in processTempAlias explaining why
we instantiate a new TempAliasTransformer per call: this avoids concurrent
queries sharing a single transformer/aliasMap and racing; although
TempAliasTransformer.run clears its map (making reuse technically safe), do not
hoist it to an executor field as an "optimization" because that would
reintroduce potential concurrency bugs—refer to processTempAlias and
TempAliasTransformer.run/aliasMap in the comment so future readers understand
the rationale.
- Around line 635-640: Add a short inline comment in processTempAlias explaining
why we instantiate a new TempAliasTransformer for each call (instead of hoisting
it to a private field): TempAliasTransformer.run() holds/resettable internal
state so reusing one instance across concurrent queries would cause a data race;
therefore keep "new TempAliasTransformer().run(query)" when
options.useCompactAliasNames is true to preserve thread-safety/concurrency.
Reference processTempAlias, TempAliasTransformer, run, and
options.useCompactAliasNames in the comment so future maintainers understand the
rationale.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17922f0 and 40f4671.

📒 Files selected for processing (10)
  • CLAUDE.md
  • packages/orm/src/client/crud/dialects/base-dialect.ts
  • packages/orm/src/client/crud/dialects/lateral-join-dialect-base.ts
  • packages/orm/src/client/crud/dialects/sqlite.ts
  • packages/orm/src/client/crud/operations/base.ts
  • packages/orm/src/client/executor/temp-alias-transformer.ts
  • packages/orm/src/client/executor/zenstack-query-executor.ts
  • packages/orm/src/client/options.ts
  • packages/orm/src/client/query-utils.ts
  • tests/regression/test/issue-2378.test.ts

@claude
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude finished @ymc9's task —— View job


PR Review: Compact Alias Names Implementation

Reviewing PR #2406 which implements compact alias names to fix PostgreSQL identifier length limitations.

Review Checklist:

  • Understand the problem and solution approach
  • Review core implementation (temp-alias-transformer.ts)
  • Analyze integration in query executor
  • Check dialect consistency changes
  • Evaluate test coverage
  • Assess potential issues and security concerns
  • Provide comprehensive feedback

Overall Assessment: EXCELLENT IMPLEMENTATION

This is a well-architected solution that effectively addresses PostgreSQL's 63-byte identifier limit with minimal risk and good performance characteristics.


Problem Analysis

Root Cause: Deep nested includes generate alias names like $$_{parentAlias}$template$caseFields$caseField$fieldOptions that exceed PostgreSQL's 63-byte identifier limit.

Test Case: The regression test demonstrates a 5-level deep include chain:

RepositoryCases -> Templates -> TemplateCaseAssignment -> CaseFields -> CaseFieldAssignment -> FieldOptions

Implementation Review

🔧 Core Solution: TempAliasTransformer (temp-alias-transformer.ts:1-27)

✅ Strengths:

  • Clean Architecture: Uses Kysely's built-in OperationNodeTransformer pattern correctly
  • Consistent Mapping: Same temp alias always maps to same short name within a query
  • State Isolation: Properly clears aliasMap per query execution in run() method
  • Focused Scope: Only transforms identifiers starting with TEMP_ALIAS_PREFIX

⚠️ Potential Issues:

  1. Alias Collision Risk: Uses $t1, $t2 pattern which could theoretically collide with user-defined aliases
  2. Off-by-one Indexing: this.aliasMap.size + 1 starts at 1, but size starts at 0 (though this is likely intentional)

🎯 Integration: Query Executor (zenstack-query-executor.ts:635-640)

✅ Strengths:

  • Correct Placement: Applied after name mapping but before query execution
  • Thread Safety: Creates new transformer instance per query (avoids concurrency issues)
  • Configurable: Controlled by useCompactAliasNames option with sensible default

📝 Documentation Need: Should add inline comment explaining why new instance is created per call.

⚙️ Configuration & Utilities

✅ Well Designed:

  • Clear Documentation: useCompactAliasNames option properly documented
  • Consistent Utilities: tmpAlias() and TEMP_ALIAS_PREFIX provide standardized approach
  • Backward Compatibility: Can be disabled if needed

Dialect Integration Review

✅ Comprehensive Coverage: All major dialects updated consistently:

  • base-dialect.ts: Core join and filter alias generation
  • sqlite.ts: SQLite-specific subquery handling
  • lateral-join-dialect-base.ts: PostgreSQL/MySQL lateral joins
  • operations/base.ts: Exists check alias renamed to $exists

Pattern Consistency: All changes properly wrap aliases with tmpAlias().


Test Coverage Assessment

✅ Excellent Test Design:

🔍 Missing Coverage:

  • No test for useCompactAliasNames: false option
  • No edge case testing (extremely deep nesting, alias collision scenarios)

Security & Performance Analysis

✅ Security:

  • No SQL Injection Risk: Works at AST level, not string manipulation
  • No User Input: Transformation happens on internal identifiers only
  • Proper Escaping: Kysely handles identifier quoting

✅ Performance:

  • O(n) Complexity: Linear with number of unique aliases (typically small)
  • Minimal Overhead: Simple Map lookup/insertion
  • Memory Efficient: Clears state per query

Critical Issues to Address

1. Alias Collision Potential ⚠️

Problem: Generated names $t1, $t2 could collide with existing identifiers.

Risk Level: Low but non-zero (Kysely supports quoted identifiers containing $)

Recommended Fix:

// temp-alias-transformer.ts:20
mapped = `$$t${this.aliasMap.size}`;  // Use $$t instead of $t

This aligns with the existing $$_ prefix convention and virtually eliminates collision risk.

2. Documentation Gap 📝

Issue: The concurrency rationale for creating new transformer instances isn't documented.

Recommended Fix: Add inline comment in processTempAlias():

// New instance per call: avoids concurrent queries sharing mutable aliasMap state
return new TempAliasTransformer().run(query);

Minor Observations

  1. Constants Change: The 'exists''$exists' change follows the compact naming convention but appears unrelated to the core fix.

  2. Starting Index: Using size + 1 means aliases start at $t1 rather than $t0, which is fine but worth noting.


Final Recommendation: ✅ APPROVE WITH MINOR FIXES

This PR effectively solves the PostgreSQL identifier length issue with a clean, well-integrated solution. The implementation follows good architectural patterns and includes comprehensive testing.

Suggested improvements:

  • Update compact alias prefix from $t to $$t for collision safety
  • Add concurrency documentation comment
  • Consider adding test for disabled option

The core implementation is solid and should resolve issue #2378 without introducing regressions.


@claude
Copy link
Contributor

claude bot commented Feb 25, 2026

Claude finished @ymc9's task —— View job


PR Code Review: Compact Alias Names Implementation

Conducting a comprehensive code review of PR #2406 which implements compact alias names to fix PostgreSQL identifier length limitations.

Review Checklist:

  • Understand the problem and solution approach
  • Review core implementation (temp-alias-transformer.ts)
  • Analyze integration in query executor
  • Check dialect consistency changes
  • Evaluate test coverage
  • Assess potential issues and security concerns
  • Provide comprehensive feedback

Overall Assessment: APPROVE WITH MINOR SUGGESTIONS

This is a well-implemented solution to a real PostgreSQL identifier length limitation issue. The approach is clean, efficient, and properly tested.


Problem Analysis

Issue: Deep nested includes in ZenStack ORM generate PostgreSQL aliases exceeding the 63-byte identifier limit, causing query failures. The regression test demonstrates a 5-level deep include chain:

RepositoryCases -> Templates -> TemplateCaseAssignment -> CaseFields -> CaseFieldAssignment -> FieldOptions

Previously, aliases like $$_{parentAlias}$template$caseFields$caseField$fieldOptions could exceed this limit.

Solution: Introduces TempAliasTransformer that replaces long temporary aliases (prefixed with $$_) with compact names ($$t1, $$t2, etc.) before query execution.


Implementation Review

🔧 Core Solution: TempAliasTransformer (temp-alias-transformer.ts:1-28)

  • Excellent approach: Uses Kysely's built-in OperationNodeTransformer pattern correctly
  • Smart mapping strategy: Maps long aliases like $$_complex_nested_name to compact forms like $$t1, $$t2
  • Consistency guarantee: Same temp alias always maps to the same short name within a query
  • Proper state management: Clears aliasMap per query execution to prevent cross-query pollution

🎯 Integration in Query Executor (zenstack-query-executor.ts:635-640)

  • Proper placement: Applied in processTempAlias() after name mapping but before query execution (line 627)
  • Configurable: Controlled by useCompactAliasNames option (defaults to true)
  • Good performance: Only runs when needed, creates new instance per query to avoid concurrency issues

⚙️ Configuration & Utilities

  • Well documented: useCompactAliasNames option properly documented and typed (options.ts:202-205)
  • Consistent patterns: tmpAlias() utility provides consistent temp alias wrapping across dialects
  • Proper constants: TEMP_ALIAS_PREFIX = '$$_' centralizes the prefix convention

🗂️ Dialect Consistency (base-dialect.ts, sqlite.ts, lateral-join-dialect-base.ts)

  • Comprehensive coverage: All dialects consistently use tmpAlias() for temporary alias generation
  • Proper integration: Policy plugin changes correctly avoid conflicts with compact aliases

Code Quality Assessment

✅ Strengths:

  1. Focused solution: Addresses the exact problem without over-engineering
  2. Follows existing patterns: Uses Kysely transformers consistently with codebase conventions
  3. Backward compatibility: Can be disabled if needed via configuration
  4. Comprehensive test: Regression test covers the exact failure scenario (issue-2378.test.ts)
  5. Minimal surface area: Only touches what's necessary, reducing risk

✅ Security & Performance:

  • No security concerns: Simple string transformation with no user input processing
  • Excellent performance: O(n) complexity where n is number of unique aliases per query
  • Memory efficient: Uses simple Map for small number of aliases per query
  • No SQL injection risk: Works at AST level, not string manipulation
  • Thread-safe: New transformer instance per query prevents concurrency issues

✅ Test Coverage:

  • Complete scenario: Tests the exact 5-level nesting that caused the original issue
  • Proper validation: Verifies both query execution and result structure integrity
  • Real-world case: Uses realistic domain model relationships

Minor Issues & Suggestions

⚠️ Potential Alias Collision Risk (temp-alias-transformer.ts:20)

Current code:

mapped = `$$t${this.aliasMap.size + 1}`;

Issue: While $$t1, $$t2 are unlikely to collide, there's a theoretical risk if other parts of the system generate similar aliases.

Suggestion: The current $$t prefix is actually good and follows the existing $$_ pattern. However, consider using this.aliasMap.size instead of this.aliasMap.size + 1 to start from $$t0:

mapped = `$$t${this.aliasMap.size}`;

📝 Documentation Enhancement

Suggestion: Add a brief comment in TempAliasTransformer explaining the PostgreSQL 63-byte limit context:

/**
 * Kysely node transformer that replaces temporary aliases created during query construction with
 * shorter names while ensuring the same temp alias gets replaced with the same name.
 * 
 * This addresses PostgreSQL's 63-byte identifier limit which can be exceeded by deep nested queries.
 */

🧪 Test Coverage Enhancement

While the core test is excellent, consider adding:

  • Test with useCompactAliasNames: false to verify the option works
  • Edge case with very long nested chains (8+ levels)

Policy Plugin Changes

The changes in expression-transformer.ts and policy-handler.ts are good:

  • Changed from '$t' to '_' aliases to avoid conflicts with the new compact alias scheme
  • Maintains functionality while preventing collision with $$t1, $$t2 pattern

Recommendation: ✅ APPROVE

This PR effectively solves the PostgreSQL identifier length limitation with a clean, performant solution. The implementation follows good software engineering practices and includes proper testing.

The minor suggestions above are optional improvements and don't block approval. The core functionality is solid and addresses the issue comprehensively.


@ymc9 ymc9 merged commit ca8f437 into dev Feb 25, 2026
8 checks passed
@ymc9 ymc9 deleted the fix/issue-2378 branch February 25, 2026 17:41
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.

[Bug] Query fails to execute when exceeding the PostgreSQL 63 byte limit on identifiers

1 participant