SimpleFileDB 1.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SimpleFileDB --version 1.0.1
NuGet\Install-Package SimpleFileDB -Version 1.0.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="SimpleFileDB" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleFileDB --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SimpleFileDB, 1.0.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 SimpleFileDB as a Cake Addin #addin nuget:?package=SimpleFileDB&version=1.0.1 // Install SimpleFileDB as a Cake Tool #tool nuget:?package=SimpleFileDB&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SimpleFileDB
SimpleFileDB is a free, fast, multiplatform, lightweight .NET Standard database library.
Databases are split into tables (stored as folders). Tables are split into rows (stored as JSON files). Rows are split into columns (stored as first-level properties in a JSON file).
Usage
using System;
using System.IO;
namespace SimpleFileDB.Sample
{
class MySampleRowClass
{
public int Aaa = 346;
public string Bbb = "Sample text.";
public float Ccc = 3.14159f;
}
class SampleProgram
{
static void Main(string[] args)
{
string pathdb = Path.GetTempFileName();
File.Delete(pathdb);
Directory.CreateDirectory(pathdb);
Console.WriteLine($"Sample database created in {pathdb}");
string table1_name = "my table";
string table1_row1_index = "first row";
string table1_row2_index = "second row";
SimpleFileDB db = new SimpleFileDB(pathdb);
db.CreateTable(table1_name);
db[table1_name][table1_row1_index] = "the content of the first row is simply a string";
Console.WriteLine($"The value of the first row is: \"{db[table1_name].GetRow<string>(table1_row1_index).Result}\".");
db[table1_name][table1_row2_index] = new MySampleRowClass();
MySampleRowClass readvalue = db[table1_name].GetRow<MySampleRowClass>(table1_row2_index).Result;
Console.WriteLine($"The second row contains a {nameof(MySampleRowClass)} object: Aaa={readvalue.Aaa}, Bbb={readvalue.Bbb}, Ccc={readvalue.Ccc}.");
Console.WriteLine($"The second row has been stored as a JSON file with contents:{Environment.NewLine}{File.ReadAllText(Path.Combine(pathdb, table1_name, table1_row2_index))}");
db[table1_name].Delete(table1_row1_index);
db[table1_name].Delete(table1_row2_index);
db.DeleteTable(table1_name, deletecontents: false);
}
}
}
Features
- Extremely easy to use.
- Multiplatform (platform agnostic).
- Each row is a simply JSON file. Therefore it can be easily stored on disk, network share, Google Drive, OneDrive...
- Row contents can be any serializable object. The value of a row can be an integer, a float, a string, or your own class.
- Read/write operations are asynchronous, so DB access does not necessarily block the rest of your application.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.