SQL
- Files
.sql- Formats as
- SQLFluff, or River when chosen
- Lints
- Every rule that reads its code
- In
ur.toml [format.sql]
Formatted
extents.sql, as written-- The space each data file uses.
select e.file_id,f.file_name,sum(e.blocks) allocated,f.blocks "FILE SIZE" from dba_extents e join dba_data_files f on e.file_id=f.file_id where f.status='AVAILABLE' group by e.file_id,f.file_name,f.blocks order by e.file_id;
ur format --style sqlfluff extents.sql-- The space each data file uses.
select e.file_id, f.file_name, sum(e.blocks) allocated, f.blocks "FILE SIZE" from dba_extents e join dba_data_files f on e.file_id = f.file_id where f.status = 'AVAILABLE' group by e.file_id, f.file_name, f.blocks order by e.file_id;
ur format --style river extents.sql-- The space each data file uses.
select e.file_id,
f.file_name,
sum(e.blocks) allocated,
f.blocks "FILE SIZE"
from dba_extents e
join dba_data_files f on e.file_id = f.file_id
where f.status = 'AVAILABLE'
group by e.file_id, f.file_name, f.blocks
order by e.file_id;
Versions
Ur reads SQL as the profiles below name it. Name the versions a project targets in target; without it, Ur reads sql-ansi.
| Profile | Dialect |
|---|---|
sql-ansi | ANSI |
sql-sqlite-3 | SQLite |
sql-mysql-5.7 | MySQL |
sql-mysql-8.4 | MySQL |
sql-mysql-9.7 | MySQL |
sql-mysql-26.7 | MySQL |
sql-postgres-14 | PostgreSQL |
sql-postgres-15 | PostgreSQL |
sql-postgres-16 | PostgreSQL |
sql-postgres-17 | PostgreSQL |
sql-postgres-18 | PostgreSQL |
sql-sparksql-3.5 | SparkSQL |
sql-sparksql-4.0 | SparkSQL |
sql-sparksql-4.1 | SparkSQL |
sql-sparksql-4.2 | SparkSQL |
sql-clickhouse-25.8 | ClickHouse |
sql-clickhouse-26.9 | ClickHouse |