https://github.com/masu-baumgartner/dbsync.net
A c# mysql model sync library
https://github.com/masu-baumgartner/dbsync.net
cshap data library mysql
Last synced: about 1 month ago
JSON representation
A c# mysql model sync library
- Host: GitHub
- URL: https://github.com/masu-baumgartner/dbsync.net
- Owner: Masu-Baumgartner
- License: mit
- Created: 2022-04-01T11:56:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-16T02:39:24.000Z (about 4 years ago)
- Last Synced: 2026-01-14T07:38:02.418Z (5 months ago)
- Topics: cshap, data, library, mysql
- Language: C#
- Homepage: https://www.nuget.org/packages/DBSync.Net
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 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
```csharp
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; }
}
```
2) Initialize table
```csharp
var table = new DBSyncTable("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
```
3) Use it
Use can use it basicly like any other IList object.
```csharp
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
```csharp
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:
- Discord: masusniper#0001
- Mail: admin@endelon-hosting.de
- Mail: marcel.kbkm@gmail.com