Skip to content

bjornharrtell/PgKeyValueDB

Repository files navigation

PgKeyValueDB

NuGet Version

Introduction

A simple as possible document database abstraction and implementation using PostgreSQL.

It uses POCO mapping to allow use of any C# instance that can be (de)serialized from/to a JSON object as a value.

Usage

It's recommended to use .NET Dependency Injection and setup via your Startup class like this:

services.AddPgKeyValueDB(connectionString);

You can then inject PgKeyValueDB as constructor parameter where you need it.

The PgKeyValueDB instance offers basic API to do Create, Update, Upsert, Get, Exists, and Remove operations (and async variants) with optional partition key and expiration.

Additional API a GetListAsync, Count and RemoveAll with Linq expression filtering support. For large partitions it's recommended to create manual indexes for specific expressions.

FAQ

What about distributed/concurrent usage?

Should be no different from standard PostgreSQL behaviour i.e https://www.postgresql.org/docs/current/transaction-iso.html. Note that default isolation level can be set in connection string with fx Options=-c default_transaction_isolation=serializable.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages