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 reads_other_sources: true,
22};
23
24pub static SQL: LanguageSupport = LanguageSupport {
29 name: "sql",
30 display_name: "SQL",
31 extensions: &[".sql"],
32 filenames: &[],
33 filename_prefixes: &[],
34 tools: &[&SQLFLUFF],
35 conventions: &[
36 "Queries that scan a whole table where an index exists",
37 "Joins missing a predicate, and accidental cross joins",
38 "NULL equality filtering out the rows it meant to match",
39 "Migrations that lock or rewrite a large table",
40 "Ordering without a tiebreaker that pages nondeterministically",
41 ],
42 vendored_dirs: &[],
43};
44
45pub(crate) static FAMILY: &[&LanguageSupport] = &[&SQL];