AIGuiders.Platform.Modeling.Language.Adapters.Sql
0.1.0
dotnet add package AIGuiders.Platform.Modeling.Language.Adapters.Sql --version 0.1.0
NuGet\Install-Package AIGuiders.Platform.Modeling.Language.Adapters.Sql -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AIGuiders.Platform.Modeling.Language.Adapters.Sql" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AIGuiders.Platform.Modeling.Language.Adapters.Sql" Version="0.1.0" />
<PackageReference Include="AIGuiders.Platform.Modeling.Language.Adapters.Sql" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AIGuiders.Platform.Modeling.Language.Adapters.Sql --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: AIGuiders.Platform.Modeling.Language.Adapters.Sql, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AIGuiders.Platform.Modeling.Language.Adapters.Sql@0.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AIGuiders.Platform.Modeling.Language.Adapters.Sql&version=0.1.0
#tool nuget:?package=AIGuiders.Platform.Modeling.Language.Adapters.Sql&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
AIGuiders.Platform.Modeling.Language.Adapters.Sql
SQL backends for the Language Resolver Center — parse diagnostics, statement-level outline and dialect invariant laws for .sql scripts, one backend per dialect.
What you get
- Four ready
ILanguageBackendimplementations over one shared core:SqlLanguageBackend— generic SQL (sql)SqlPostgresLanguageBackend(sql.postgres),SqlMssqlLanguageBackend(sql.mssql),SqlSqliteLanguageBackend(sql.sqlite)
SqlLanguageActivation—CanHandlerules: a.sqlpath plus session language-id hint matching (aliasespostgres;mssql/tsql;sqlite; the generic backend accepts empty/sql/generichints and yields to any dialect hint)- Diagnostics per dialect, two layers:
- parse errors from the bundled SQL parser, id
sql.parse - dialect invariant laws from
SqlInvariantLaws(ids likesql.script/no-top):- PostgreSQL / SQLite — errors on
SELECT TOPandDATEADD() - MSSQL — errors on trailing
LIMITand PostgreSQL interval date syntax - Generic — portability warnings/hints for
TOP,LIMIT,DATEADD(), interval syntax, bracket identifiers
- PostgreSQL / SQLite — errors on
- parse errors from the bundled SQL parser, id
GetDocumentSymbolsAsync— one symbol per statement: kind = statement type (select,insert, …), name =kind_indexSqlDialect—Generic/Postgres/Mssql/SqliteDU, plusSqlDialect.lawCode;SqlInvariantLaws.evaluateis pure and usable standalone- Semantic verbs (
GoToDefinitionAsync,FindUsagesAsync,GetCompletionsAsync,GetSymbolAtPositionAsync,RenameSymbolAsync) are intentional stubs
Quick start
open AIGuiders.Platform.Modeling.Language
open AIGuiders.Platform.Modeling.Language.Adapters.Sql
// Standalone law check — no backend host needed
let violations =
SqlInvariantLaws.evaluate
SqlDialect.Postgres "report.sql" LanguageIds.SqlPostgres
"SELECT TOP 5 * FROM orders;"
// Or as a full backend verb (parse + law diagnostics)
let backend = SqlMssqlLanguageBackend() :> ILanguageBackend
let hint : ProjectHint =
{ SolutionOrProjectPath = ""; SessionDefaultLanguageId = "tsql" }
backend.CanHandle("report.sql", hint) // true
Problem
- SQL scripts move between engines, and dialect drift is silent:
SELECT TOPruns on SQL Server but not on PostgreSQL;DATEADD()and::date + INTERVALmark a script as written for one engine. - Generic parsers catch syntax errors but not "valid T-SQL sitting in a Postgres repo" — and polyglot tooling still wants
.sqlfiles to answer the same verbs as code files.
Solution
- A dialect-aware backend set on one parser: each backend claims
.sqlfiles via the session language hint, then layers engine-specific invariant laws on top of parse diagnostics — the laws are a small closed vocabulary with stable ids, so CI can gate on them. - Dialects are wired from the
language.sql.*profile flavours of ADR-0067; the backends fill the SQL slots of the Language Resolver Center (ADR-0061).
When not to use
- Not a SQL validator/linter general: the laws are a closed regex set (
TOP,LIMIT,DATEADD, interval, bracket identifiers), one diagnostic per script per rule — no full grammar or dialect coverage beyond that. - No semantic tier: navigation, usages, completions and rename return empty; the outline is statement-level (
select_1,insert_2), not tables/columns. - Dialect pick needs the session hint — a bare
.sqlpath alone routes to the generic backend; if your tool cannot supply aProjectHint, you only get portability warnings, not engine-specific errors.
Learn more
MIT · Source & issues · part of the Guiders federation
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- AIGuiders.Platform.Modeling.Language (>= 0.1.0)
- FSharp.Core (>= 10.1.401)
- OutWit.Database.Parser (>= 14.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 27 | 10/24/2026 |