P41.NoSQLite 0.3.0-beta.40

This is a prerelease version of P41.NoSQLite.
dotnet add package P41.NoSQLite --version 0.3.0-beta.40
                    
NuGet\Install-Package P41.NoSQLite -Version 0.3.0-beta.40
                    
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.3.0-beta.40" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="P41.NoSQLite" Version="0.3.0-beta.40" />
                    
Directory.Packages.props
<PackageReference Include="P41.NoSQLite" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add P41.NoSQLite --version 0.3.0-beta.40
                    
#r "nuget: P41.NoSQLite, 0.3.0-beta.40"
                    
#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.
#:package P41.NoSQLite@0.3.0-beta.40
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=P41.NoSQLite&version=0.3.0-beta.40&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=P41.NoSQLite&version=0.3.0-beta.40&prerelease
                    
Install as a Cake Tool

NoSQLite

Build Action Publish Action Downloads

License .NET 8 .NET 9 .NET 10

A C# library built using SQLitePCL.raw to use SQLite as a NoSQL database.

The library aims to provide simple low level methods that are used to create your own data access layers. For now the library uses a single connection class which creates/uses tables that have a single column called documents. In reality it should work for other tables with more columns as long as they contain one column called documents but no tests have been made or run for this use case.

To use the library you must ensure you are using an SQLite that contains the JSON1 extension. As of version 3.38.0 (2022-02-22) the JSON functions and operators are built into SQLite by default.

Getting Started

Install some version of SQLitePCL.raw to create your sqlite3 object.

You can look at the test project for more pragmatic usage. The test project uses SQLitePCLRaw.bundle_e_sqlite3 nuget pacakge to use sqlite.

Connection

Using your sqlite3 db create a new instances of the NoSQLiteConnection and optionally pass a JsonSerializerOptions object.

Once you use the connection be very careful on the consequences of switching your JsonSerializerOptions object.

Disposing NoSQLiteConnection will not close your sqlite3 db or do anything with it. It will just cleanup it's associated table and statement instances.

Tables

You get a table using connection.GetTable({TableName})

Tables are created if they do not exist. If you request a table multiple times you will always get the same table instance.

At the table level the following methods are supported: | Method | Description | |- |- | | Count/CountLong | Returns the number of rows in the table. | | All | Returns all rows in the table. Deserialized to T | | Clear | Clears the table. | | Exists | Check if a document exists. | | Find | Returns the document if it exists or throws. | | Add | Adds a document. | | Update | Updates a document (replace). | | Delete | Deletes a document. | | IndexExists | Check if an index exists. | | CreateIndex | Creates an index if it does not exists using "{TableName}_{IndexName}" (can also set unique flag). | | DeleteIndex | Deletes an index if it does exist. |

Documents

At the document level the following methods are supported: | Method | Description | |- |- | | FindProperty | Finds a document by key and returns a property value. | | Insert | Inserts a property value into a document by key. Overwrite NO, Create YES. | | Replace | Replaces a property value in a document by key. Overwrite YES, Create NO. | | Set | Sets a property value in a document by key. Overwrite YES, Create YES. |

Examples

Build

To build this project .NET 10 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 net8.0 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.40 169 10/29/2025
0.3.0-beta.39 114 10/25/2025
0.3.0-beta.36 150 10/20/2025
0.3.0-beta.0 185 7/15/2023
0.3.0-beta.-1 164 7/14/2023
0.2.0-beta.3 192 4/27/2023
0.2.0-beta.1 222 11/12/2022
0.1.0-beta.8 245 10/19/2022
0.1.0-beta.4 225 10/14/2022
0.1.0-beta.3 214 10/13/2022
0.1.0-beta.1 260 9/22/2022