Coder Social home page Coder Social logo

dbsync.net's Introduction

DBSync.Net

A c# library used to syncronice model lists with databases

Note:

This library is still under development. If you use it for production you do this on your own risk

Features:

  • One or more database server support
  • Optional encryption for important data
  • Only c# has to be used. No SQL needed
  • In-Memory cache
  • Threadsafe

Future Features:

  • Store json objects
  • Encrypt json objects
  • Connection string builder

Quick Start

  1. Create a model
public class TestyModel : IDBSyncModel
{
   [Key("id")] // This is not optional
   [PrimaryKey]
   [AutoIncrement]
   public int Id { get; set; }

   [Key("text")]
   [Length(324)] // Custom max. length
   public string Text1 { get; set; } // The property name must not be the key name

   [Key("data")]
   [Encrypt] // This encrypts the value with the provided key which can be set in the table properties 
   public string Data { get; set; }
}
  1. Initialize table
var table = new DBSyncTable<TestyModel>("tablename");

table.ConnectionString = new DBSyncConnectionString()
{
   // Set with properties here
};
table.EncryptionKey = "Optional, encryption key";

table.Init(); // This creates the table in the db if its missing and loads data from it to the cache
  1. Use it

Use can use it basicly like any other IList object.

table.Add(new TestyModel()
{
   Text1 = "Hmmmm",
   Data = "Secret"
});

table.Clear();

Additional things:

You can configure a global connection string and encryption key which will be used if its not set before

DBSyncGlobal.ConnectionString = "This will be used on every table if its not set for this table specificly";
DBSyncGlobal.EncryptionKey = "Same as above";

Examples can be found in the test project

Licensing:

See LICENSE file

Contact:

If you have any questions feel free to ask me via:

dbsync.net's People

Contributors

masu-baumgartner avatar daniel-balk avatar

Stargazers

Dominik Downarowicz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.