How amazing is PL/.NET?

PL/.NET is a free software project that extends PostgreSQL to support stored procedures, functions, and DO blocks for the .NET platform, including both C# and F#.

In our tests, it is the fastest procedural language in PostgreSQL, and it has the widest range of unit testing. It natively supports 39 out of 46 standard user types, the widest range of any external procedural language in PostgreSQL. We hope to make it the best procedural language in PostgreSQL and the best implementation of .NET stored procedures in any database.

Our goal is to provide developers with modern, capable development environments and programming languages, and also allow them to easily move the code to the data instead of forcing the data to come to the code. We think this would make the world a better place.

To make that happen, we want PL/.NET to be the best stored procedure languages for PostgreSQL and the best \dotnet\ stored procedure language in any database. We also want to improve the overall ecosystem within PostgreSQL for stored procedure languages.

Specific Goals Include:

  • Complete support for all standard PostgreSQL data types
  • Support for all aggregate types: ranges, arrays, sets, records
  • Rich support for C# and F#, including clear and detailed compiler error messages
  • High performance
  • Memory safety
  • Compatibility with Npgsql, the existing \dotnet PostgreSQL client library
  • Limited compatibility with the C# stored-procedure support in MS SQL Server and IBM DB/2
  • Full support, via the standard Npgsql API, for calling PostgreSQL from \dotnet functions via the Server Programming Interface (SPI)
  • Leveraging PostgreSQL’s rich security model
  • Comprehensive testing
  • Good configurability
  • An improved the PostgreSQL ecosystem for other procedural languages via shared testing and cooperation

We Are Off to a Good Start:

  • Languages: C# and F# both fully supported
  • Datatypes: 39 out of 46 PostgreSQL user (non-system) data types, plus their arrays
  • All data types are nullable
  • Set-Returning Functions, including returning records for virtual tables, are supported
  • SPI is working and is 100% compatible with NPGSQL
  • Code can be entered directly via \texttt{CREATE FUNCTION} or, alternatively, loaded from a pre-compiled assembly
  • Performance is very good in our benchmarks, surpassing all other external PL implementations
  • Testing: we have 820 unit tests; all types, plus their arrays and nulls, are fully unit-tested in both C# and F#
  • Security: Code for each function is isolated in a \dotnet Assembly Load Context, providing some security protectionBoldBold