Commit Graph

473 Commits

Author SHA1 Message Date
Simon Binder f9fa123e4a Forbid unqualified access to aliases in triggers 2024-01-01 19:18:04 +01:00
Simon Binder 08ceb939bc
Include `NULL` constraints in node->sql 2023-12-12 21:46:58 +01:00
Simon Binder 1563b99b58
Fix potential crash whne resolving columns 2023-12-07 00:10:49 +01:00
Simon Binder fcce984af4
Merge branch 'add-update-column-name-list' into develop 2023-11-18 00:32:33 +01:00
tibotix 6810cfc52d
Refactor `TypeResolver.visitMultiColumnSetComponent` 2023-11-17 18:15:23 +01:00
tibotix e08bb30585
Use `_consumeIdentifier` instead of `_consume` 2023-11-17 17:55:18 +01:00
tibotix 5e26cae5e9
Rename `useAsRowValue` -> `usedAsRowValue` to be consistent 2023-11-17 02:10:23 +01:00
tibotix f282ead955
Allow RowValue to be used in SetComponent expressions 2023-11-17 01:48:27 +01:00
tibotix f128f05e1e
Add MultiColumnSetComponent to support column-name-list update syntax
This commit refactors the SetComponent into an abstract interface and introduces
two separate classes `SingleColumnSetComponent` and `MultiColumnSetComponent`, as
well as related methods such as `visitSingleColumnSetComponent` / `visitMultiColumnSetComponent`.
All Visitors were updated accordingly, and logic for parsing / type-resolving / linting were added
too. The only thing missing is type-resolving for the case where rowValue is of type SubQuery,
i.e.

`UPDATE demo SET (a,b)=(SELECT 2,3)`.
2023-11-17 01:42:39 +01:00
Simon Binder 220c7125a3
Update to lints 3.0.0 2023-11-16 21:25:21 +01:00
Simon Binder 222dc3063e
sqlparser: Support new SQL functions 2023-10-24 22:56:12 +02:00
Simon Binder 559cf986a1
sqlparser: Support `ORDER BY` in functions 2023-10-24 22:32:39 +02:00
Simon Binder d70de95382 Make `sum()` nullable 2023-10-22 12:33:03 +02:00
Simon Binder cfa33f9a02
Fix typo in error message of insert col list 2023-10-10 21:59:03 +02:00
Simon Binder 7f0488056c
Add more tests for custom types 2023-10-07 21:52:48 +02:00
Simon Binder eb03ac5ff0
Fix converters on `int64` breaking inference 2023-10-03 20:54:28 +02:00
Simon Binder d0a3feee12
Fix star columns resolving to too many columns 2023-09-26 23:15:29 +02:00
Simon Binder 93b9cc512d Analyze index annotations for tables 2023-09-14 15:37:21 +02:00
Simon Binder fe242e5a17 Support `timediff` and `octet_length` 2023-08-17 17:30:45 +02:00
Simon Binder d84767b93d Support references to builtin tables (#2567) 2023-08-17 00:15:36 +02:00
Simon Binder 83885791c7
Fix parser crashes around `CREATE` 2023-08-12 22:33:54 +02:00
Simon Binder 0ed132f642
Fix crash at trailing comma in FROM clause 2023-08-09 15:24:10 +02:00
Simon Binder 28e44cbea8
First support for MariaDB in compiled queries 2023-07-27 11:16:58 +02:00
Simon Binder 3f74d65e69
Support nested columns for any result set 2023-07-23 23:57:00 +02:00
Simon Binder cc83a58d89
Report invalid statements in parseMultiple 2023-07-21 21:07:55 +02:00
Simon Binder 03d3c837be
Add support for subqueries.
Closes #612.
2023-07-20 22:30:20 +02:00
Simon Binder 625eacf5f1
Add parseMultiple API to sqlparser (#2519) 2023-07-16 00:29:29 +02:00
Simon Binder c700b5b4be
Resolve CTEs for compound selects 2023-06-20 14:17:53 +02:00
Simon Binder e481f29138
Fix resolving table aliases (#2453) 2023-06-03 23:10:54 +02:00
Simon Binder 07fe555753
Report syntax error for WITH in trigger 2023-06-01 00:08:41 +02:00
Simon Binder 9154f60dfd
Improve resolving recursive CTEs 2023-05-30 13:53:03 +02:00
Simon Binder 18868221d9
Support doc comments for columns in drift files 2023-05-10 12:00:44 +02:00
Simon Binder 6bb2c3d2c5
Support named constructors for rows in drift file 2023-04-23 16:21:31 +02:00
Simon Binder db15b792ca
Fix column name inference in CTEs and subqueries 2023-04-20 16:43:27 +02:00
Simon Binder 611fd4c4e9
Fix crash with CTE on insert/update/delete 2023-04-20 15:37:51 +02:00
Simon Binder 11b563f9de
Add static analysis for the `IIF` function (#2392) 2023-04-18 12:42:51 +02:00
Simon Binder a988b38ec1
Improve error message for invalid column name 2023-04-16 18:37:34 +02:00
Simon Binder 99abaae2f1
Fix infinite loop in trigger parser 2023-04-14 11:47:15 +02:00
Simon Binder 834cc154bc
Infer types for `HAVING` clauses 2023-04-08 15:58:06 +02:00
Simon Binder bdac301866
Allow references to result column in group by too 2023-04-08 15:44:47 +02:00
Simon Binder 4e05067bd5
Don't assume nullable if no join syntax is known 2023-03-26 22:21:48 +02:00
Simon Binder c38e9cc6c0
Fix false-positive trigger syntax error (#2360) 2023-03-26 21:44:12 +02:00
Simon Binder ba86f1aa89
Use correct variable indexes around nested queries 2023-03-15 17:48:36 +01:00
Simon Binder 849f245f53
Warn about invalid custom foreign key constraint 2023-03-13 22:30:14 +01:00
Simon Binder cc16156c84
Merge branch 'postgres3' into develop 2023-02-25 13:16:33 +01:00
Simon Binder 1c662ebb1a
Analysis support for sqlite 3.41.0 2023-02-22 23:05:17 +01:00
Fabian Freund dc9a9e2db3 fix parsing of nested cte's 2023-02-15 10:18:26 +01:00
Simon Binder e2136236d9
Improve error messages for keyword functions 2023-02-08 10:52:48 +01:00
Simon Binder deb1b91d41
Escape postgres keywords in generated SQL 2023-02-05 14:28:19 +01:00
Simon Binder 7175b83d2b
Add missing space when formatting window functions 2023-01-20 18:14:37 +01:00