Config file

Project configuration lives in syntaqlite.toml. The CLI, LSP server, and all editor integrations read it.

Discovery

syntaqlite walks up from the current working directory and uses the first syntaqlite.toml it finds. Use --config <path> to point at a specific file.

File format

# Default schema for SQL files that don't match any glob in [schemas].
# Optional. If omitted, unmatched files get no schema.
# schema = ["schema.sql"]

# SQLite version to emulate (e.g. "3.47.0", "latest").
# sqlite-version = "3.47.0"

# SQLite compile-time flags to enable.
# sqlite-cflags = ["SQLITE_ENABLE_MATH_FUNCTIONS", "SQLITE_ENABLE_FTS5"]

# Schema DDL files for validation and completions.
# Each entry maps a glob pattern to schema file(s).
[schemas]
"src/**/*.sql" = ["schema/main.sql", "schema/views.sql"]
"tests/**/*.sql" = ["schema/main.sql", "schema/test_fixtures.sql"]
"migrations/*.sql" = []  # no schema validation

# Formatting options (all optional, shown with defaults).
[format]
line-width = 80
indent-width = 2
keyword-case = "upper"    # "upper" | "lower"
semicolons = true

# Per-category check levels (all optional, shown with defaults).
[checks]
parse-errors = "deny"       # "allow" | "warn" | "deny"
unknown-table = "warn"
unknown-column = "warn"
unknown-function = "warn"
function-arity = "warn"
cte-columns = "deny"
qualified-ref = "deny"
index-on-view = "deny"
drop-wrong-kind = "deny"
builtin-modify = "deny"
compound-columns = "deny"
unknown-window = "deny"
on-clause-order = "deny"
values-terms = "deny"
insert-values = "deny"
subquery-columns = "deny"
row-value = "deny"
# schema = "deny"           # shorthand for all 4 schema checks

schema

Top-level key. Default schemas applied to SQL files that don't match any [schemas] glob.

  • Type: array of strings (file paths relative to the config file directory)
  • Optional

[schemas]

Maps glob patterns to schema DDL file(s). Globs are matched against the SQL file's path relative to the directory containing syntaqlite.toml. Entries are checked in file order; first match wins.

  • Type: table of "glob pattern" = ["schema_file.sql", ...]
  • Optional

Schema resolution order:

  1. [schemas] glob entries (first matching glob wins)
  2. schema top-level key (fallback for unmatched files)
  3. No schema (syntax-only checks)

Schema files contain SQL DDL (CREATE TABLE, CREATE VIEW, etc.), the same format as sqlite3 mydb.db .schema output.

sqlite-version

SQLite version to emulate. Controls which keywords and functions are recognized by the parser and analyzer.

  • Type: string (e.g. "3.47.0", "latest")
  • Optional, defaults to latest
  • Equivalent to --sqlite-version on the CLI

sqlite-cflags

SQLite compile-time flags to enable. Controls which extensions and optional features are available during analysis.

  • Type: array of strings (e.g. ["SQLITE_ENABLE_MATH_FUNCTIONS", "SQLITE_ENABLE_FTS5"])
  • Optional, defaults to empty (no extra flags)
  • Equivalent to --sqlite-cflag on the CLI (repeatable)

Common flags:

FlagWhat it enables
SQLITE_ENABLE_MATH_FUNCTIONSsin(), cos(), log(), pow(), etc.
SQLITE_ENABLE_ORDERED_SET_AGGREGATESpercentile_cont(), percentile_disc(), mode(), median()
SQLITE_ENABLE_JSON1json(), json_extract(), etc.
SQLITE_ENABLE_FTS5fts5() full-text search

Functions gated behind a flag you didn't specify will be flagged as unknown.

[format]

All formatting fields are optional and use built-in defaults when omitted. CLI flags take precedence over values in this section.

KeyTypeDefaultDescription
line-widthinteger80Target maximum line width
indent-widthinteger2Spaces per indentation level
keyword-casestring"upper""upper" or "lower"
semicolonsbooleantrueAppend semicolons after statements

See Formatting options for detailed descriptions of each option.

[checks]

Each field sets a diagnostic category to "allow" (suppress), "warn", or "deny" (error). Omitted fields use built-in defaults, and CLI flags (-A/-W/-D) take precedence.

KeyTypeDefaultDescription
parse-errorsstring"deny"Syntax errors from the parser
unknown-tablestring"warn"Unresolved table/view references
unknown-columnstring"warn"Unresolved column references
unknown-functionstring"warn"Unresolved function names
function-aritystring"warn"Wrong number of function arguments
cte-columnsstring"deny"CTE column count mismatches
qualified-refstring"deny"Qualified names like t.a in index expressions and generated columns
index-on-viewstring"deny"CREATE INDEX on a view
drop-wrong-kindstring"deny"DROP TABLE on a view or DROP VIEW on a table
builtin-modifystring"deny"DROP, ALTER, CREATE INDEX or CREATE TRIGGER on a built-in table such as sqlite_schema
compound-columnsstring"deny"Compound SELECT arms with different numbers of result columns
unknown-windowstring"deny"OVER naming a window the query doesn't define
on-clause-orderstring"deny"An outer join's ON clause referencing a table joined to its right
values-termsstring"deny"VALUES rows with a different number of terms than the first row
insert-valuesstring"deny"INSERT statements supplying a different number of values than the columns they fill
subquery-columnsstring"deny"Subqueries returning a different number of columns than a value or IN takes
row-valuestring"deny"Row values used as a single value, or compared with a row value of a different width
schemastringN/AShorthand for unknown-table, unknown-column, unknown-function, function-arity
allstringN/AShorthand for all categories

When a schema is provided (--schema or syntaqlite.toml), schema checks default to "deny" instead of "warn". Explicit [checks] values override this.

Precedence

CLI flags always override config file values. When --sqlite-version or --sqlite-cflag is passed on the command line, it takes precedence over sqlite-version and sqlite-cflags in the config file. Likewise, --schema overrides [schemas] and schema.

Consumers

ConsumerBehavior
syntaqlite fmtDiscovers config from input file directory or cwd. Format options are defaults; CLI flags override.
syntaqlite analyzeDiscovers config from input file directory or cwd. Schema resolution from config when --schema is not given.
syntaqlite lspDiscovers config from cwd at startup. Loads schema catalog and format config.
VS Code, Claude Code, Neovim, HelixThe LSP reads syntaqlite.toml directly. No editor-specific configuration needed.