-
Notifications
You must be signed in to change notification settings - Fork 5
Closed
Labels
Description
Description
Add support for array subscript access and slicing operations.
Example SQL
-- Array subscript (single element)
SELECT tags[1] FROM posts;
SELECT matrix[2][3] FROM data;
-- Array slicing
SELECT tags[1:3] FROM posts;
SELECT arr[2:] FROM table_name; -- From index 2 to end
SELECT arr[:5] FROM table_name; -- From start to index 5Current Behavior
Array subscript [n] may work, but slicing [n:m] is not supported.
Expected Behavior
Parser should handle both single subscript and slice range syntax.
Priority
Medium - enhances PostgreSQL array support
Implementation Notes
- Create
ArraySubscriptExpressionAST node for single subscript - Create
ArraySliceExpressionAST node for range slicing - Handle optional start/end in slice syntax