P41.NoSQLite 0.1.0-beta.1

This is a prerelease version of P41.NoSQLite.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package P41.NoSQLite --version 0.1.0-beta.1
NuGet\Install-Package P41.NoSQLite -Version 0.1.0-beta.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="P41.NoSQLite" Version="0.1.0-beta.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add P41.NoSQLite --version 0.1.0-beta.1
#r "nuget: P41.NoSQLite, 0.1.0-beta.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install P41.NoSQLite as a Cake Addin
#addin nuget:?package=P41.NoSQLite&version=0.1.0-beta.1&prerelease

// Install P41.NoSQLite as a Cake Tool
#tool nuget:?package=P41.NoSQLite&version=0.1.0-beta.1&prerelease

NoSQLite: NoSQL on top of SQLite

Release NuGet MIT License

A thin wrapper above sqlite to use it as a nosql database.

Getting Started

All you need to is an instance of NoSQLiteConnection, the instance requires a string that is a full path to the database file and you can optionally provide your own JsonSerializerOptions to configure the JSON serialization/deserialization.

NoSQLiteConnection create and open a connection when initialized so keep in mind that you will have to dispose it when you are done using the Dispose method of the IDisposable interface.

In most scenarios you will create it and store it to use it until you should down your application.

The sqlite database is configured with journal_mode set to WAL.

How It Works

It works by taking advantage of the JSON1 through the SQLitePCLRaw.bundle_e_sqlite3 nuget package that forces the correct version of sqlite to manipulate the documents, create indexes and more in the future!

Document Management

Example class that will be used below:

public class Person
{
    public string Name { get; set; }
    public string Surname { get; set; }
    public string? Description { get; set; }
}

and the same connection:

var db = new NoSQLiteConnection("path to database file", "json options or null");
Creating/Updating documents.

Creating or Updating a document happens from the same insert method, keep in mind that this always replaces the document with the new one.

var panos = new Person
{
    Name = "panoukos",
    Surname = "41",
    Description = "C# dev"
}

db.Insert("panos", panos);

Get documents.

var doc = db.Get<Person>("panos");
Deleting documents.
db.Remove("panos"); // Will remove the document.
db.Remove("panos"); // Will still succeed even if the document doesn't exist.

Build

To build this project .NET 7 is needed.

Contribute

Contributions are welcome and appreciated, before you create a pull request please open a GitHub Issue to discuss what needs changing and or fixing if the issue doesn't exist!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.0-beta.0 75 7/15/2023
0.3.0-beta.-1 71 7/14/2023
0.2.0-beta.3 72 4/27/2023
0.2.0-beta.1 91 11/12/2022
0.1.0-beta.8 114 10/19/2022
0.1.0-beta.4 91 10/14/2022
0.1.0-beta.3 87 10/13/2022
0.1.0-beta.1 122 9/22/2022