# PL/.NET ![PL.NET LOGO](./PL-NET_LOGO.png) PL/.NET (or simply _pldotnet_) adds full support for C# and F# to PostgreSQL. 0.99 is our public beta release. - In our benchmarks, PL/.NET is the fastest PL in PostgreSQL - We support all Procedural Language (PL) operations: functions, procedures, DO, SPI, triggers, records, SRF, OUT/INOUT, table functions, etc - We natively support 38 out of 46 standard user types, the most of any non-native PL - We are the only PL using the native database API; our database access(SPI) is fully NPGSQL-compatible - We support both SQL-embedded code blocks and also loading functions from DLLs - We have extensive testing, with 1065 unit tests across both C# and F# - 100% free software under the PostgreSQL license Our white paper has extensive discussion of all of these items; check it out. ## Getting started To get started with PL/.NET, you will need to install it on your PostgreSQL server or run it with a Docker container. You can find more information in our [Installation Guide](https://github.com/Brick-Abode/pldotnet/blob/master/INSTALL.md). In this RUDB source tree, `pldotnet` is built separately from `full_build.sh`. Use the helper scripts in this directory: - `./prepare_linux_build_env.sh` installs or validates Linux build prerequisites - `./build_install.sh` builds and installs the extension for the `pg_config` you point it to Detailed installation and usage instructions can also be found in the pldotnet [Wiki pages](https://github.com/Brick-Abode/pldotnet/wiki), along with examples and information on the supported PostgreSQL data types. Feel free to open an issue or a discussion topic on our GitHub repository. ## Pre-built Docker Images We provide ready-to-use Docker images to make running PL/.NET fast and simple. Two variants are available: - `brickabode/pldotnet:latest` – Lean and production-ready image. - `brickabode/pldotnet:dev` – Development image with testing tools and examples. Example: pull and start the development image for quick experimentation: ```bash docker pull brickabode/pldotnet:dev docker run --rm -it \ --name pldotnet-test \ -p 5432:5432 \ brickabode/pldotnet:dev bash ``` Use `latest` in production deployments, and `dev` when you want a fully equipped environment for building, testing, or exploring PL/.NET features. ## Usage examples Here is an example that returns a set of records in C#: ```sql CREATE OR REPLACE FUNCTION dynamic_record_generator_srf(lim INT8) RETURNS SETOF record AS $$ var upperLimit = lim.HasValue ? lim : System.Int32.MaxValue; for(long i=0;i