PostgresQuery 0.1.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package PostgresQuery --version 0.1.3
                    
NuGet\Install-Package PostgresQuery -Version 0.1.3
                    
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="PostgresQuery" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PostgresQuery" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="PostgresQuery" />
                    
Project file
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 PostgresQuery --version 0.1.3
                    
#r "nuget: PostgresQuery, 0.1.3"
                    
#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 PostgresQuery@0.1.3
                    
#: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=PostgresQuery&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=PostgresQuery&version=0.1.3
                    
Install as a Cake Tool

PostgresQuery

Lightweight .NET wrapper around libpg_query. Prebuilt native binaries for Linux, Windows, and macOS are included in the NuGet package. Windows and macOS builds have not been tested, so be warned.

GitHub repository for the original parser: libpg_query

Install

dotnet add package PostgresQuery

Quick start

using PostgresQuery;

var ast = Parser.Parse("SELECT 1 AS value");
Console.WriteLine($"Postgres version: {ast.Version}");

var normalized = Parser.Normalize(" select  1 /* comment */ ");
var fingerprint = Parser.Fingerprint("select 1");
var statements = Parser.Split("select 1; select 2;");

Building and testing

The repository ships with a Docker-based build that produces the NuGet package and runs the consumer tests against it:

./run.sh            # builds into ./out and runs PostgresQuery.Tests
PACKAGE_VERSION=0.1.0 ./run.sh   # override package version

Generated protobuf bindings and NuGet package are produced inside the Docker build and emitted under out/.

License

PostgreSQL server source code, used under the PostgreSQL license. Portions Copyright (c) 1996-2023, The PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California

The libpg_query library is licensed under the 3-clause BSD license. All other parts are licensed under the 3-clause BSD license, see LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

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.4 1,183 12/8/2025
0.1.3 318 12/7/2025
0.1.1 218 12/7/2025
0.1.0 220 12/7/2025