@@ -47,11 +47,15 @@ support SQL embedded in other languages
4747
4848parse and warn, helps with copy pasting examples
4949
50+ https://www.enterprisedb.com/blog/psqls-scripting-language-turing-complete-or-fibonacci-psql
51+
5052### Other Dialects
5153
5254support Trino, BigQuery, Aurora DSLQ, etc.
5355
54- ### Check ` format() ` calls
56+ ### Validations
57+
58+ #### Check ` format() ` calls
5559
5660https://www.postgresql.org/docs/18/functions-string.html#FUNCTIONS-STRING-FORMAT
5761
@@ -63,6 +67,47 @@ SELECT format('Hello %s %s', 'World');
6367-- error ^^
6468```
6569
70+ #### Warn about invalid column notation
71+
72+ ``` sql
73+ with t as (select 1 as data)
74+ select (data).id from t;
75+ ```
76+
77+ postgres says:
78+
79+ ```
80+ Query 1 ERROR at Line 40: : ERROR: column notation .id applied to type integer, which is not a composite type
81+ LINE 2: select (data).id from t;
82+ ^
83+ ```
84+
85+ #### Warn about invalid missing column notation
86+
87+ ``` sql
88+ create type f as (
89+ id integer ,
90+ name text
91+ );
92+ with t as (select (1 , ' a' )::f as data)
93+ select data .id from t;
94+ ```
95+
96+ postgres says:
97+
98+ ```
99+ Query 1 ERROR at Line 41: : ERROR: missing FROM-clause entry for table "data"
100+ LINE 2: select data.id from t;
101+ ^
102+ ```
103+
104+ we should suggest an autofix to:
105+
106+ ``` sql
107+ with t as (select (1 , ' a' )::f as data)
108+ select (data).id from t;
109+ ```
110+
66111### Formatter
67112
68113``` shell
@@ -137,6 +182,10 @@ sql for benchmarks maybe?
137182
138183 https://github.com/cedardb/DOOMQL
139184
185+ - rrule_plpgsql
186+
187+ https://github.com/sirrodgepodge/rrule_plpgsql
188+
140189### CLI
141190
142191from ` deno `
@@ -589,7 +638,7 @@ via: https://www.postgresql.org/docs/17/sql-createview.html
589638
590639https://www.postgresql.org/docs/17/sql-dropgroup.html
591640
592- ### Rule: ` create table as ` to ` select into `
641+ ### Rule: ` select into ` to ` create table as `
593642
594643` ` ` sql
595644SELECT * INTO films_recent FROM films WHERE date_prod >= ' 2002-01-01' ;
0 commit comments