All Projects → Khelechy → CSJsonDB

Khelechy / CSJsonDB

Licence: MIT license
A C# package that performs basic CRUD ( Create, Read, Update, Delete ) operations on a Json file, used for sample minimalistic DBs.

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to CSJsonDB

dapper-repositories
CRUD for Dapper
Stars: ✭ 523 (+597.33%)
Mutual labels:  crud, nuget
covidtrackerapiwrapper
CovidSharp is a crossplatform C# API wrapper for the Coronavirus tracking API (https://github.com/ExpDev07/coronavirus-tracker-api)
Stars: ✭ 11 (-85.33%)
Mutual labels:  nuget, csharp-library
Microorm.dapper.repositories
CRUD for Dapper
Stars: ✭ 424 (+465.33%)
Mutual labels:  crud, nuget
aarbac
An Automated Role Based Access Control .NET framework with T-SQL Query Parser which automatically parse select, insert, update, delete queries based on the logged in user role
Stars: ✭ 18 (-76%)
Mutual labels:  crud, nuget
Node Mysql Utilities
Query builder for node-mysql with introspection, etc.
Stars: ✭ 98 (+30.67%)
Mutual labels:  crud, db
tefact
🏭 (Beta) 轻量级无代码/低代码 H5、表单编辑器。Lightweight no-code/low-code editor for website、H5 page and Form. Build your page without code!
Stars: ✭ 244 (+225.33%)
Mutual labels:  crud
dark-sky-core
A .NET Standard Library for using the Dark Sky API.
Stars: ✭ 55 (-26.67%)
Mutual labels:  nuget
django-dedal
Fast CRUD implemetation for Django.
Stars: ✭ 14 (-81.33%)
Mutual labels:  crud
elastic-crud
Simple yet elegant ElasticSearch Crud Repository.
Stars: ✭ 46 (-38.67%)
Mutual labels:  crud
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+4312%)
Mutual labels:  nuget
PortaCapena.OdooJsonRpcClient
Odoo Client Json Rpc
Stars: ✭ 39 (-48%)
Mutual labels:  nuget
AloeDB
Light, Embeddable, NoSQL database for Deno 🦕
Stars: ✭ 111 (+48%)
Mutual labels:  db
simpledb
No description or website provided.
Stars: ✭ 50 (-33.33%)
Mutual labels:  db
DomainResult
Tiny package for decoupling domain operation results from IActionResult and IResult types of ASP.NET Web API
Stars: ✭ 23 (-69.33%)
Mutual labels:  nuget
xunit-to-junit
This Extensible Stylesheet Language Transformations can transform a xUnit.net v2 XML test results file into a JUnit test results file.
Stars: ✭ 21 (-72%)
Mutual labels:  nuget
derivejs
DeriveJS is a reactive ODM - Object Document Mapper - framework, a "wrapper" around a database, that removes all the hassle of data-persistence by handling it transparently in the background, in a DRY manner.
Stars: ✭ 54 (-28%)
Mutual labels:  db
hasor
Hasor是一套基于 Java 语言的开发框架,区别于其它框架的是 Hasor 有着自己一套完整的体系,同时还可以和先有技术体系做到完美融合。它包含:IoC/Aop容器框架、Web框架、Jdbc框架、RSF分布式RPC框架、DataQL引擎,等几块。
Stars: ✭ 938 (+1150.67%)
Mutual labels:  db
sam-python-crud-sample
This project is an example about lambda, SAM, dynamodb. This repository contains source code and supporting files for a serverless application that you can deploy with the SAM CLI. It includes the following files and folders.
Stars: ✭ 71 (-5.33%)
Mutual labels:  crud
damas-core
JSON storage service. RESTful, CRUD, multi-user.
Stars: ✭ 50 (-33.33%)
Mutual labels:  crud
UnityAssemblies
Simple, forward-compatible references to ANY Unity DLL on ANY platform.
Stars: ✭ 65 (-13.33%)
Mutual labels:  nuget

CSJsonDB

Introduction

This is a simple C# package that performs basic CRUD ( Create, Read, Update, Delete ) operations on a Json file, used for sample minimalistic DBs.

Installation

Install via .NET CLI

dotnet add package CSJsonDB --version 1.1.0

Install via Package Manager

Install-Package CSJsonDB --version 1.1.0

Add the namespace directive using CSJsonDB; IMPORTANT

Sample DB users.db

{
    "users": [
      {
        "id": 1,
        "firstname": "kelechi",
        "lastname": "onyekwere",
        "age": 19,
        "verified": true
      },
      {
        "id": 2,
        "firstname": "john",
        "lastname": "doe",
        "age": 33,
        "verified": true
      },
      {
        "id": 3,
        "firstname": "mark",
        "lastname": "parker",
        "age": 20,
        "verified": false
      }
    ]
  }

Load the Sample DB IMPORTANT

var db = JsonDB.Load("filepathtosampledb/users.db");

Available Methods 🧨

NOTE
Responses are returned as objects. You can use .ToJsonString() method to return json string from a json object

Load

var db = JsonDB.Load(string filePath);

ToJsonString

db.Select("users").Where("id", 2).ToJsonString();

result: string Returns the json string of the object.

Select

db.Select(string table);

Sample

db.Select("users");

result: object

[
      {
        "id": 1,
        "firstname": "kelechi",
        "lastname": "onyekwere",
        "age": 19,
        "verified": true
      },
      {
        "id": 2,
        "firstname": "john",
        "lastname": "doe",
        "age": 33,
        "verified": true
      },
      {
        "id": 3,
        "firstname": "mark",
        "lastname": "parker",
        "age": 20,
        "verified": false
      }
]

Where

db.Select(string table).Where(string key, dynamic value);

Sample

db.Select("users").Where("id", 2);

result: List<dynamic>

[
      {
        "id": 2,
        "firstname": "john",
        "lastname": "doe",
        "age": 33,
        "verified": true
      },
]

Add

db.Add(string table, object newData);

Sample

var newUser = new {
    id = 3,
    firstname = matt,
    lastname = doe,
    age = 23,
    verified = false
};

db.Add("users", newUser);

result: void

Delete

db.Delete(string table, string key, dynamic value);

Sample

db.Delete("users", "id", 1);

result: void

Update

db.Update(string table, string key, dynamic value, object newData);

Sample

var updateUser = new {
    verified = true
};

db.Update("users", "id", 3, updateUser);

result: object

[
      {
        "id": 3,
        "firstname": "mark",
        "lastname": "parker",
        "age": 20,
        "verified": true
      },
]

Contribution

If you find an issue with this package or you have any suggestion please help out. I am not perfect.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].