drep/languages/definitions/
sql.rs1use crate::languages::spec::{
4 DEFAULT_TOOL_TIMEOUT_SECS, DiagnosticsStream, LanguageSupport, OutputFormat, ToolSpec,
5};
6
7pub static SQLFLUFF: ToolSpec = ToolSpec {
9 name: "sqlfluff",
10 command: &["sqlfluff", "lint", "--format", "json"],
11 local_paths: &["venv/bin/sqlfluff", ".venv/bin/sqlfluff"],
12 config_files: &[".sqlfluff"],
13 config_flag: None,
14 output_format: OutputFormat::Sqlfluff,
15 diagnostics_stream: DiagnosticsStream::Stdout,
16 timeout_secs: DEFAULT_TOOL_TIMEOUT_SECS,
17 timeout_context: None,
18 establishes_compilation: false,
19 serial_in_repository: false,
20 accepts_files: true,
21};
22
23pub static SQL: LanguageSupport = LanguageSupport {
28 name: "sql",
29 display_name: "SQL",
30 extensions: &[".sql"],
31 filenames: &[],
32 filename_prefixes: &[],
33 tools: &[&SQLFLUFF],
34 conventions: &[
35 "Queries that scan a whole table where an index exists",
36 "Joins missing a predicate, and accidental cross joins",
37 "NULL equality filtering out the rows it meant to match",
38 "Migrations that lock or rewrite a large table",
39 "Ordering without a tiebreaker that pages nondeterministically",
40 ],
41 vendored_dirs: &[],
42};
43
44pub(crate) static FAMILY: &[&LanguageSupport] = &[&SQL];