Skip to content

Ankus

PostgreSQL extensions in C#, built with .NET Native AOT
[PgFunction]
public static int Add(int a, int b)
=> checked(a + b);
SELECT add(40, 2); -- 42
[PgFunction] Attributes declare functions, aggregates, operators, casts, triggers and types. A source generator writes the SQL and the C entry points.
Native AOT Each extension is one native library. The server needs no .NET installation.
PgException PostgreSQL errors never unwind through managed code. They reach you as exceptions you can catch.
Spi.Sql Query from inside the backend. Interpolated values become bound parameters, not SQL text.
Replication Stream logical changes from another server and apply them through the executor, as PostgreSQL's own subscriber does.
ankus test Tests run inside a real server and roll back, as pgrx tests do. Add --all for every registered version.

PostgreSQL 13 through 18 and the 19 beta and release candidate on Linux, macOS and Windows