Skip to content

SQL Dialects

FlowScope supports 13 SQL dialects with varying levels of syntax coverage. Selecting the correct dialect ensures accurate parsing of dialect-specific functions, quoting styles, and statement syntax.

DialectUse For
genericUnknown or mixed SQL
ansiStandard ANSI SQL
postgresqlPostgreSQL, CockroachDB
snowflakeSnowflake Data Cloud
bigqueryGoogle BigQuery
duckdbDuckDB
redshiftAmazon Redshift
mysqlMySQL, MariaDB
mssqlMicrosoft SQL Server
sqliteSQLite
hiveApache Hive
databricksDatabricks SQL
clickhouseClickHouse

Use the dialect dropdown in the editor toolbar. The default is generic which handles most standard SQL.

Use the -d or --dialect flag:

Terminal window
flowscope -d snowflake queries/*.sql
flowscope --dialect bigquery analytics.sql

Pass the dialect in the request:

const result = await analyzeSql({
sql: 'SELECT * FROM orders',
dialect: 'postgresql'
});
-- Array syntax
SELECT array_agg(name) FROM users;
SELECT tags[1] FROM posts;
-- Dollar quoting
SELECT $tag$literal string$tag$;
-- Type casting
SELECT '2024-01-01'::date;
SELECT CAST(amount AS numeric(10,2));
-- Array operations
SELECT * FROM orders WHERE tags @> ARRAY['urgent'];
-- Lateral flatten
SELECT f.value:name::string
FROM orders,
LATERAL FLATTEN(input => items) f;
-- Semi-structured data
SELECT data:customer:name FROM events;
-- Variant type
SELECT PARSE_JSON('{"key": "value"}');
-- Time travel
SELECT * FROM orders AT(TIMESTAMP => '2024-01-01'::timestamp);
-- Struct and array
SELECT STRUCT(1 AS a, 'hello' AS b);
SELECT ARRAY<INT64>[1, 2, 3];
-- Unnest
SELECT * FROM UNNEST([1, 2, 3]) AS num;
-- Safe navigation
SELECT SAFE.PARSE_DATE('%Y-%m-%d', date_str);
-- Backtick identifiers
SELECT * FROM `project.dataset.table`;
-- List comprehension
SELECT [x * 2 FOR x IN [1, 2, 3]];
-- Struct access
SELECT struct.field FROM data;
-- Positional joins
SELECT * FROM t1 POSITIONAL JOIN t2;
-- Friendly SQL
SELECT * FROM 'data.parquet';
SELECT * FROM read_csv_auto('file.csv');
-- Backtick identifiers
SELECT `column` FROM `table`;
-- LIMIT syntax
SELECT * FROM orders LIMIT 10, 20;
-- String functions
SELECT CONCAT_WS('-', year, month, day);
-- INSERT ... ON DUPLICATE KEY
INSERT INTO t (id, val) VALUES (1, 'a')
ON DUPLICATE KEY UPDATE val = VALUES(val);
-- DISTKEY and SORTKEY
CREATE TABLE orders (
id INT,
date DATE SORTKEY
) DISTSTYLE KEY DISTKEY(id);
-- COPY command
COPY orders FROM 's3://bucket/data'
CREDENTIALS 'aws_iam_role=...'
FORMAT AS PARQUET;
-- Spectrum external tables
SELECT * FROM spectrum.external_table;

Different dialects use different quoting styles:

DialectQuote StyleExample
PostgreSQLDouble quotes"Column Name"
MySQLBackticks`Column Name`
BigQueryBackticks`project.dataset.table`
SQL ServerBrackets[Column Name]
ANSIDouble quotes"Column Name"

FlowScope normalizes identifiers internally for lineage tracking.

FlowScope recognizes dialect-specific functions:

FunctionDialects
ARRAY_AGGPostgreSQL, BigQuery, Snowflake
STRING_AGGPostgreSQL, BigQuery
GROUP_CONCATMySQL
LISTAGGSnowflake, Redshift
LISTDuckDB
FunctionDialects
DATE_TRUNCPostgreSQL, Snowflake, BigQuery, DuckDB
DATE_PARTPostgreSQL, Snowflake, Redshift
EXTRACTAll dialects
DATEDIFFSnowflake, MySQL, SQL Server
DATE_SUBBigQuery, MySQL
FunctionDialects
CONCATAll dialects
SUBSTRINGANSI standard
SUBSTROracle-style dialects
SPLITBigQuery, Snowflake
REGEXP_EXTRACTBigQuery
REGEXP_MATCHESPostgreSQL

Some dialect features produce parsing warnings:

  • Procedural code (stored procedures, functions with bodies)
  • Dialect-specific hints and pragmas
  • Administrative commands (GRANT, REVOKE)
  • Exotic statement types (EXPLAIN, ANALYZE)

FlowScope skips unsupported statements and continues with the rest.

When using the generic dialect:

  • Only ANSI-standard syntax is guaranteed
  • Dialect-specific functions may not be recognized
  • Some valid SQL may produce parse errors

Always select the specific dialect when known for best results.

FlowScope does not auto-detect dialects. Common indicators to help you choose:

IndicatorLikely Dialect
Backtick identifiersMySQL, BigQuery
:: type castsPostgreSQL, DuckDB
FLATTENSnowflake
UNNESTBigQuery
DISTKEYRedshift
Dollar quotingPostgreSQL