sqlode/verify

sqlode verify — static, read-only verification lane.

generate stops at the first error it encounters so codegen can still produce useful output for a partially-working project. verify is the opposite: it walks every block in the config, runs the same schema parsing and query analysis the generator uses, collects every failure it can see, and layers additional static checks on top (today: query_parameter_limit enforcement). It never writes files.

The command is intended as the first phase of the Issue #395 verification roadmap — later phases will add DB-backed analysis (database / analyzer config concepts) and execution-lane validation. Keeping the static surface here means those later phases can grow Finding with new variants without reshaping the command wiring.

Types

One concrete problem the verifier found. block_out names the sql.gen.gleam.out of the block the finding applies to so reports with multiple blocks stay attributable without inventing a synthetic block identity.

pub type Finding {
  Finding(block_out: String, detail: String)
}

Constructors

  • Finding(block_out: String, detail: String)

Outcome of a single verification pass. A report with an empty findings list means every block in the config parsed, analysed and satisfied the configured static policies.

pub type Report {
  Report(findings: List(Finding))
}

Constructors

pub type VerifyError {
  ConfigError(config.ConfigError)
}

Constructors

Values

pub fn error_to_string(error: VerifyError) -> String
pub fn report_to_string(report: Report) -> String
pub fn run(config_path: String) -> Result(Report, VerifyError)

Entry point. Loads the config at config_path, resolves relative paths the same way generate.run does, and returns a report. The result is Ok(Report) even when the project has problems — only unrecoverable errors (missing config, YAML syntax errors) surface as Error.

pub fn verify_config(cfg: model.Config) -> Report

Verify an already-loaded and path-resolved model.Config. Broken out so tests can build a config value directly and assert against the findings list without touching the filesystem.

Search Document