Repository navigation
sqlint-extensions - #30
Merged
Merged
Conversation
- postgres/go.mod and sqlint/go.mod require github.com/standards-lab/sqlate v0.8.0 (on the Go proxy); each builds and tests with GOWORK=off, and postgres's integration-tagged code vets with GOWORK=off. - postgres/CHANGELOG.md: the Unreleased additions move under a v0.9.0 section dated 2026-11-24, with a Changed entry and a "Requires" line for v0.8.0 in the form of earlier releases; [Unreleased] stays empty and compares from postgres/v0.9.0. - sqlint/CHANGELOG.md: the v0.8.0 requirement recorded under Unreleased as a non-breaking Changed entry, since the linter's API and findings do not change. - No tag is created; tagging happens at ship.
sqlint.toml accepts a top-level extensions list, read into Config.Extensions. Load refuses, one line each: a value that is not a list of strings, an empty entry, an entry listed twice, and any extensions while engine is unset. [export] accepts reason, a string, into Export.Reason, beside forms or an empty native_forms table. Export.NativeForms carries the three states slice 3 reads: nil when no native_forms table is declared, an empty non-nil map when it is declared empty, entries otherwise. The same Export type serves readExport, so an extension module's file decodes the same way when Lint reads it. The guide documents the extensions key, its refusals, and an extension module's export.
Lint finds each extensions entry through the engine's lookup: a module path (dotted first segment) through the Resolver, anything else as a directory of the tree. It accepts a module whose export names at least one native form, or an empty native_forms table beside a non-empty reason; it refuses a missing table and an empty one without a reason. Load already validated the list, so Lint validates only resolution and the module's export. Findings against sqlint.toml, the rest of the tree still linted: - extensions: <entry>: <error>, for an entry that does not resolve or has no sqlint.toml (the entry is named even when the error names it, since a module root's error reads ". declares no sqlint.toml"); - extensions: <entry> exports neither native forms nor a reason; - extensions: <entry>: native_forms.<name>: <error>, the module's other forms still applied. Accepted forms join the engine's deny list and are matched through the same path, so tier, role switches, overrides and stripping are shared. A finding from an extension's form reads "(<name>, from <entry>)"; the engine's message is unchanged, and a name the engine and an extension both export is reported once for each. The guide, the package doc, and the changelog's Unreleased section describe the lookup, the findings, the message, the native: header convention, and review keeping extensions in step with migrate.Options.Extensions.
… the engine and each extension
… claims an unchanged API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v1.data.extensions · task 2/5 · sqlint-extensions
Summary
extensionskey. The native forms of each listed module join theengine's deny list for standard-tier files.
[export.native_forms]. If it has no forms, it declares an emptytable beside a new
[export] reason. A listed module with neither is refused.v0.9.0, which SHIPtags. sqlint's changes stay under Unreleased.
review conventions: the
native:header names the extension, and the list stays in step withmigrate.Options.Extensions.Core changes
Config.ExtensionsandExport.Reason:Loadvalidates the list, refusing an emptyentry, a repeated one, a value that isn't a list of strings, and
extensionswithoutengine. Why: the configuration validates where it loads.Export.NativeFormsis nil when thetable is absent and empty when it is declared
{}.Lint: each entry is found the wayengineis: a module paththrough the
Resolver, otherwise a tree directory. A lookup failure, a refusal, or a badexpression is a finding against
sqlint.toml, and the rest of the tree is still linted. Why:it reuses the engine's lookup and failure form, now one shared
producerhelper."<=>" (cosine_distance, from vec) in a standard-tier file; …. Why: a form name shared by theengine and an extension stays unambiguous. Engine findings are byte-for-byte unchanged.
GOWORK=off.Verify
mise run check: ✓ all three modules build, vet, test and lint with 0 issues;sqlint: okcd postgres && GOWORK=off go list -m github.com/standards-lab/sqlate && GOWORK=off go test ./...→
v0.8.0, ok. The same insqlint/.sqlint/cmd/sqlintand run it over a tree that has an engine, an extension directoryvecexportingcosine_distance = '<=>', andextensions = ["vec"]. A standard-tier<=>gives"<=>" (cosine_distance, from vec) in a standard-tier file; …. The same operatorin a native-tier file, a literal, a comment, or a role with
native_forms = falsegivesnothing.
formless(no table) andunexplained({}with no reason) → eachgives
sqlint.toml: extensions: <entry> exports neither native forms nor a reason. Listnowhere→extensions: nowhere: …. The other findings still appear.extensions = ["vec", ""], or dropengine→Loadprints onesqlint.toml:refusalline each.
Decided without you
extensions: <entry>: <error>,extensions: <entry> exports neither native forms nor a reason,extensions: <entry>: native_forms.<name>: <error>, andextensions[N]: empty/"x" is listed twice. Each names the entry because a module's lookup error doesn't.It gets one bad-expression finding per form and no refusal.
NativeFormscarries absent versus declared-empty, instead of a separatefield.
producerhelper (standards review).sqlint/doc.gomentions extensions.extensionskey; … or is refused. No sqlint check againstOptions.Extensions.": the guide states it.v0.8.0alone. …": this task carries it out.Loadrefuses
extensionswithoutengine": the guide states it.native:header stays free text …": the guide statesthe convention.
postgres-extensions.md"sqlint" section moves fromforms = []to an empty table plusreason, with entries as module paths or directories.Redirects and escalations
none
Merge danger: one-way for the
postgres/v0.9.0tag, which accepting authorizes: postgres'sExtensionCatalogmethods andpgtest.MigratedWithbecome public, requiring sqlate v0.8.0.sqlint's key merges unreleased and stays two-way · blast radius: sqlate only; sqlint's outside
consumers are unaffected until a sqlint release · sqlate: merge waits on CI
Needs you: none