JustyBase.NetezzaSqlParser
0.3.0-preview.3
See the version list below for details.
dotnet add package JustyBase.NetezzaSqlParser --version 0.3.0-preview.3
NuGet\Install-Package JustyBase.NetezzaSqlParser -Version 0.3.0-preview.3
<PackageReference Include="JustyBase.NetezzaSqlParser" Version="0.3.0-preview.3" />
<PackageVersion Include="JustyBase.NetezzaSqlParser" Version="0.3.0-preview.3" />
<PackageReference Include="JustyBase.NetezzaSqlParser" />
paket add JustyBase.NetezzaSqlParser --version 0.3.0-preview.3
#r "nuget: JustyBase.NetezzaSqlParser, 0.3.0-preview.3"
#:package JustyBase.NetezzaSqlParser@0.3.0-preview.3
#addin nuget:?package=JustyBase.NetezzaSqlParser&version=0.3.0-preview.3&prerelease
#tool nuget:?package=JustyBase.NetezzaSqlParser&version=0.3.0-preview.3&prerelease
JustyBase Netezza SQL
Open-source .NET libraries for working with Netezza SQL without requiring a live database connection.
The solution contains six libraries:
| Library | Purpose |
|---|---|
JustyBase.NetezzaSqlParser |
Lexer, recursive-descent parser, AST, formatter, linter, completion, and editor-authoring services. |
JustyBase.NetezzaDdl |
Netezza DDL text builders, identifier/literal helpers, import/maintenance SQL, and external-table option mapping. |
JustyBase.NetezzaCatalogSql |
Reusable SQL statements for reading Netezza catalog metadata. |
JustyBase.Netezza |
UI-agnostic metadata models, schema adapter for the parser, and DDL input mapping. |
JustyBase.Core |
Shared host-agnostic app core: risk analysis, scripting dialect, execution contracts, schema cache/catalog ports. |
JustyBase.ImportExport |
Shared Netezza import engines and tabular export writers used by Avalonia and Legacy hosts. |
Status
This project is in active development and currently targets net10.0. The parser is designed for Netezza SQL and NZPLSQL grammar used by JustyBase tooling. It is not a database driver and does not open connections or execute SQL by itself. Shared app-core packages (JustyBase.Core, JustyBase.ImportExport) hold host-agnostic risk/import/export/scripting surfaces; see docs/shared-core-status.md for production vs scaffold.
The public API and supported grammar may evolve before the first stable 1.0.0 release. Use tagged GitHub releases when consuming the source.
Parse and format SQL
using JustyBase.NetezzaSqlParser.Formatter;
using JustyBase.NetezzaSqlParser.Lexer;
using JustyBase.NetezzaSqlParser.Parser;
const string sql = "SELECT account_id, amount FROM sales WHERE amount > 0";
var tokens = NzLexer.Tokenize(sql).ToArray();
var parser = new NzSqlParser(tokens);
var statement = parser.Parse();
if (statement is not null && parser.Errors.Count == 0)
{
string formattedSql = NzSqlFormatter.Format(statement);
Console.WriteLine(formattedSql);
}
else
{
foreach (var error in parser.Errors)
Console.Error.WriteLine($"{error.Code}: {error.Message}");
}
The resulting AST is made of immutable record types in JustyBase.NetezzaSqlParser.Ast and can be traversed with NzSqlVisitor or inspected directly.
Netezza authoring and DDL
NetezzaSqlCatalog provides the shared function, signature, data-type, and Netezza keyword catalog used by completion, hover, and signature help:
using JustyBase.NetezzaSqlParser.Authoring;
if (NetezzaSqlCatalog.TryGetFunction("HASH", out var hash))
Console.WriteLine(hash.Signatures[0].Label);
JustyBase.NetezzaDdl also supports one deployment script for catalog-derived objects:
using JustyBase.NetezzaDdl;
using JustyBase.NetezzaDdl.Models;
var sql = new NetezzaBatchDdlBuilder().Build(new NetezzaBatchDdlInput(
Tables: tables,
Views: views,
Procedures: procedures));
The batch builder preserves object order, reuses the single-object builders, and reports objects skipped because required metadata is missing. Catalog query helpers for schemas, object types, storage statistics, and descriptions are available from NetezzaCatalogSql.
Lint SQL
using JustyBase.NetezzaSqlParser.Linter;
using var validator = new SqlValidator();
var result = validator.Validate("SELECT * FROM sales");
foreach (var issue in result.Issues)
Console.WriteLine($"{issue.StartLine}:{issue.StartColumn} {issue.RuleId}: {issue.Message}");
Pass an implementation of ISchemaProvider to SqlValidator when semantic analysis needs database metadata.
Build and test from source
Requires the .NET 10 SDK.
dotnet restore .\JustyBase.NetezzaSql.sln
dotnet build .\JustyBase.NetezzaSql.sln -c Release
dotnet test .\JustyBase.NetezzaSql.sln -c Release
pwsh .\eng\Verify-Local.ps1
Before pushing to master, prefer Verify-Local.ps1 (build, tests, coverage gates, whitespace) — see docs/local-ci.md.
The test suite covers parser and linter conformance, malformed SQL, runtime behavior, DDL helpers, and regression cases.
Optional database-backed smoke tests are documented in docs/live-tests.md.
Create NuGet packages
The four libraries can be packed independently:
dotnet pack .\JustyBase.NetezzaSqlParser.csproj -c Release
dotnet pack .\JustyBase.NetezzaDdl\JustyBase.NetezzaDdl.csproj -c Release
dotnet pack .\JustyBase.NetezzaCatalogSql\JustyBase.NetezzaCatalogSql.csproj -c Release
dotnet pack .\JustyBase.Netezza\JustyBase.Netezza.csproj -c Release
Each package includes README and XML documentation. The CI workflow builds, tests, packs, and uploads all four packages as one artifact.
Runnable examples
The repository includes a small console application demonstrating parsing, formatting, schema-aware linting, completion, DDL generation, and catalog SQL:
dotnet run --project .\samples\JustyBase.NetezzaSql.Sample\JustyBase.NetezzaSql.Sample.csproj
The sample uses in-memory metadata and does not connect to a Netezza database.
Compatibility and limitations
- Netezza-specific SQL and NZPLSQL syntax is the primary compatibility target.
- Parser support is intentionally broader than the formatter's canonical output for some command-tail statements.
- Catalog SQL is generated as text; callers remain responsible for connection management, permissions, and execution.
- The libraries do not validate that generated SQL is accepted by a particular Netezza appliance version.
- Treat database, schema, object, and search values passed to catalog SQL helpers as untrusted input and use the documented escaping/validation contract.
See docs/compatibility.md for the supported surface and CONTRIBUTING.md for development guidance.
The Node.js-to-C# behavioral boundary is maintained in docs/node-parity.md. The project does not publish from CI; see docs/release.md for the manual GitHub and NuGet handoff.
License
Licensed under the Apache License 2.0.
Netezza and IBM are trademarks of their respective owners. This project is not affiliated with or endorsed by IBM.
| 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. |
-
net10.0
- Superpower (>= 3.2.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on JustyBase.NetezzaSqlParser:
| Package | Downloads |
|---|---|
|
JustyBase.Netezza
UI-agnostic Netezza metadata, parser schema, and DDL integration components. |
|
|
JustyBase.UCanAccessCs
Pure .NET reader/writer for Microsoft Access database files (.mdb/.accdb) - a port of Jackcess/UCanAccess. |
|
|
JustyBase.Sqlite
UI-agnostic SQLite metadata, parser schema, and DDL integration components. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.2 | 134 | 8/16/2026 |
| 0.8.1 | 98 | 8/14/2026 |
| 0.8.0 | 224 | 8/10/2026 |
| 0.6.0 | 119 | 8/6/2026 |
| 0.5.2 | 111 | 8/5/2026 |
| 0.5.1 | 110 | 8/5/2026 |
| 0.5.0 | 106 | 8/5/2026 |
| 0.4.1 | 111 | 8/4/2026 |
| 0.4.0 | 114 | 8/4/2026 |
| 0.3.0 | 197 | 8/2/2026 |
| 0.3.0-preview.9 | 66 | 8/1/2026 |
| 0.3.0-preview.8 | 62 | 7/31/2026 |
| 0.3.0-preview.7 | 59 | 7/31/2026 |
| 0.3.0-preview.6 | 63 | 7/31/2026 |
| 0.3.0-preview.5 | 67 | 7/30/2026 |
| 0.3.0-preview.3 | 80 | 7/26/2026 |
| 0.3.0-preview.2 | 62 | 7/26/2026 |
| 0.3.0-preview.1 | 65 | 7/26/2026 |
| 0.2.0-preview.7 | 63 | 7/25/2026 |
| 0.2.0-preview.6 | 73 | 7/24/2026 |