SimpleDB 0.0.9

There is a newer version of this package available.
See the version list below for details.
dotnet add package SimpleDB --version 0.0.9                
NuGet\Install-Package SimpleDB -Version 0.0.9                
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="SimpleDB" Version="0.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SimpleDB --version 0.0.9                
#r "nuget: SimpleDB, 0.0.9"                
#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 SimpleDB as a Cake Addin
#addin nuget:?package=SimpleDB&version=0.0.9

// Install SimpleDB as a Cake Tool
#tool nuget:?package=SimpleDB&version=0.0.9                

SimpleDB

About

SimpleDB allows you to design your tables using standard C# classes, there are a number of methods for standard CRUD operations and support for the following features:

  • Foreign Keys
  • Unique indexes across multiple properties
  • Before and after triggers for insert, update and select
  • Sequences for unique indexes
  • Select Caching Strategy for individual classes (tables)
    • None - Records are read from storage as required.
    • Memory - Records are kept in memory.
    • Sliding - Records are retained in memory for n ms and when no longer used, memory is released. -Select Write Strategy for individual classes (tables)
    • Forced - Records are saved immediately to storage
    • Lazy - Records are saved periodically to storage or after specific time.
  • Compression types for saving that is saved
    • None - Data is not compressed
    • Brotli - Data is compressed prior to saving

How it works

The class represents a record (row) of data, which exposes properties for the data (columns), there is a TableAttribute that defines the policies for the table of data. The class must descend from TableRowDefinition class in order to work.

Only properties which are public get/set are saved to storage, read only properties are not saved. One important caveat is that the set method must call the Update() method which is defined in TableRowDefinition, this ensures that any changes are recognised when performing insert or update actions.

    [Table("Settings", CompressionType.Brotli, CachingStrategy.None)]
    internal class SettingsDataRow : TableRowDefinition
    {
        string _name;
        string _value;

        public string Name
        {
            get
            {
                return _name;
            }
            set
            {
                if (_name == value)
                    return;

                _name = value;
                Update();
            }
        }

        public string Value
        {
            get
            {
                return _value;
            }
            set
            {
                if (_value == value)
                    return;

                _value = value;
                Update();
            }
        }
    }

Registering Tables

SimpleDB has been designed with IoC in mind, tables can be registered and retrieved through DI engines.

    services.AddSingleton(typeof(TableRowDefinition), typeof(SettingsDataRow));

Using tables

    internal sealed class SettingsProvider : IApplicationSettingsProvider
    {
        private readonly ISimpleDBOperations<SettingsDataRow> _settingsData;

        public SettingsProvider(ISimpleDBOperations<SettingsDataRow> settingsData)
        {
            _settingsData = settingsData ?? throw new ArgumentNullException(nameof(settingsData));
        }
    }

You can then call methods on _settingsData to perform normal CRUD operations.

More Information

More information is available at https://www.pluginmanager.website/Docs/ or by visiting the GitHub Homepage https://github.com/k3ldar/.NetCorePluginManager

Please note the version number follows the parent project version

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 (1)

Showing the top 1 NuGet packages that depend on SimpleDB:

Package Downloads
PluginManager.DAL.TextFiles

Plugin Manager

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.6.1 90 6/12/2024
5.6.0 486 12/1/2023
5.5.2 125 11/25/2023
5.5.1 237 10/12/2023
5.5.0 121 10/9/2023
5.4.0 390 9/2/2023
5.3.0 167 7/30/2023
5.2.0 162 7/30/2023
5.1.0 218 6/11/2023
5.0.3 577 11/24/2022
5.0.0 585 11/15/2022
0.0.9 426 8/19/2022
0.0.1 420 8/14/2022

Supports net core 3.1, net5.0 and net 6.0