Weasel.Postgresql

Npgsql Helpers and Postgresql Schema Migration Tool, spin off of Marten


Keywords
database, mssql, postgresql, sql
License
MIT
Install
Install-Package Weasel.Postgresql -Version 2.0.0-alpha.4

Documentation

Weasel

Nuget Package Nuget

Weasel is a library for low level database development with Postgresql and Sql Server. Weasel is in the process of being extracted from Marten with the goal of making this code reusable in other projects.

Read also more in Introducing Weasel for Database Development by Jeremy D. Miller.

Support Plans

JasperFx logo

While Weasel is open source, JasperFx Software offers paid support and consulting contracts for Weasel.

Running tests locally

To run tests, you need to set up databases locally. The easiest option is to do it by running Docker images. You can use predefined Docker Compose setup by calling in your terminal:

docker compose up

It'll spin up PostgreSQL and MSSQL databases.

Then, you can run tests from the terminal:

dotnet test

Or your favourite IDE.

Test Config Customization

Some of our tests are run against a particular PostgreSQL version. If you'd like to run different database versions, you can do it by setting POSTGRES_IMAGE or MSSQL_IMAGE env variables, for instance:

POSTGRES_IMAGE=postgres:15.3-alpine MSSQL_IMAGE=mcr.microsoft.com/mssql/server:2022-latest docker compose up

Tests explorer should be able to detect database version automatically, but if it's not able to do it, you can enforce it by setting postgresql_version to a specific one (e.g.)

postgresql_version=15.3

By default Postgres tests are run with case insensitive names. To run tests against case sensitive, set environment variable:

USE_CASE_SENSITIVE_QUALIFIED_NAMES=true