Repository navigation
Closed
Labels
enhancementNew feature, sensor, or structural signaturelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds exist
Description
Parent: #2516
Language: IBM DB2 SQL / SQL PL
Extensions: .sql, .ddl, .dml
Lexical Family: standard_block (uses -- for line comments and /* */ for block comments).
Scoping Situation
Currently, GitGalaxy only has a sqlite parser claiming the .sql and .ddl extensions. SQLite is structurally insufficient for parsing enterprise IBM DB2 schemas and Stored Procedures (SQL PL), which contain heavy business logic, physical storage allocations (TABLESPACE), and complex control flow. For mainframe legacy modernization analyses, capturing the logic locked inside DB2 stored procedures is critical.
🚨 Critical Extension Conflict: We must resolve the .sql / .ddl conflict between sqlite and the new db2_sql profile.
- Action Required: Configure
discriminatorsin thedb2_sqlprofile (e.g.,[".cbl", ".jcl", ".bms", ".pli"]) so the detector intelligently routes.sqlfiles to the DB2 parser instead of SQLite when analyzing a mainframe ecosystem.
We need code that covers:
- x (Topology):
func_starttargetingCREATE PROCEDURE,CREATE FUNCTION, andCREATE TRIGGER.class_starttargetingCREATE TABLE,CREATE VIEW, andCREATE TABLESPACE. - y (Business Logic in Stored Procs):
branchcapturing SQL PL control flow (IF,ELSEIF,CASE,WHILE,REPEAT).state_mutationcapturingINSERT,UPDATE,DELETE,SET, andMERGE. - z (Database Mechanics):
encapsulationforGRANT/REVOKEsecurity boundaries.iocapturingFETCH,OPEN, andCLOSEcursor operations.
Implementation Requirements
- Follow
how_to_add_a_language.mdto map DB2 SQL/SQL PL syntax. - Implement the discriminator-based extension conflict resolution for
.sqland.ddl. - Write
tests/extraction/languages/test_db2_sql_strict.pyensuring the parser correctly handles massive legacy schema dumps without ReDoS or backtracking delays.
Metadata
Metadata
Assignees
Labels
enhancementNew feature, sensor, or structural signaturelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingpriority: highCore feature broken, but workarounds exist
Activity
Add IBM DB2 SQL / SQL PL (db2_sql), resolving the .sql collision with…
Add IBM DB2 SQL / SQL PL (db2_sql), resolving the .sql collision with…
Language-addition process: registration audit, add-language skill, de…
Language-addition cost ledger: record + analyze time/tokens/$ per lan…
Activate auth_middleware as a first-class domain sensor across the re…