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;

Try it in the playground →

Versions

Ur reads SQL as the profiles below name it. Name the versions a project targets in target; without it, Ur reads sql-ansi.

ProfileDialect
sql-ansiANSI
sql-sqlite-3SQLite
sql-mysql-5.7MySQL
sql-mysql-8.4MySQL
sql-mysql-9.7MySQL
sql-mysql-26.7MySQL
sql-postgres-14PostgreSQL
sql-postgres-15PostgreSQL
sql-postgres-16PostgreSQL
sql-postgres-17PostgreSQL
sql-postgres-18PostgreSQL
sql-sparksql-3.5SparkSQL
sql-sparksql-4.0SparkSQL
sql-sparksql-4.1SparkSQL
sql-sparksql-4.2SparkSQL
sql-clickhouse-25.8ClickHouse
sql-clickhouse-26.9ClickHouse