Skip to content

.NET embedded high performance NoSQL database system.

License

Notifications You must be signed in to change notification settings

korayakpinar/MochaDB

 
 

Repository files navigation

alt text

Gitter license .NET Core Build Status Build Status

MochaDB is a user-friendly, loving database system that loves to help.
Come on, meet the world's most advanced .NET database system!


Featured features

  • Open source and free for everyone
  • Always up to date!
  • Serverless
  • File based
  • High performance
  • Lightweight
  • Small
  • Secure
  • Embedded
  • RDBMS(Relational Database Management System) features
  • Restore unwanted changes with logs
  • Embed files into the database with FileSystem
  • Full compatible with .NET Core, .NET Standard and .NET Framework
  • Script build and debug with MochaScript
  • MochaQ for simple and fast querys
  • Supports LINQ querys
  • Encrypted database file
  • Object oriented management support
  • MochaDB Studio for databases management with graphical user interface
  • Single DLL
  • Single database file
  • Portable

Usage areas

  • Remotely accessible database with a provided server
  • Desktop applications
  • Web sites/applications
  • Mobile applications
  • Data storages of servers
  • Libraries
  • Games

MochaDB Studio

Manage with a powerful management system! preview


Preview


Querying

You cannot work with SQL queries, but with MochaQ you can do basic operations with custom commands and work with LINQ queries.

  var tables = DB.GetTables();
  var result =
    from table in tables
    where table.Name.StartsWith("A") && table.Columns.Count > 0
    select table;
  
  return result;

Of course, when you pull data from the database, you can also query it directly. For this, MochaDB strives to help you, as always!

var tables = DB.GetTables(x=> x.Name.StartsWith("A") && x.Columns.Count > 0);



MochaQ

MochaQ offers quick basic queries. With MochaQuery, you can process and run queries.

Use

MochaDatabase db = new MochaDatabase("path=.\\Databases\\Math.mochadb; AutoConnect=True");
string value = db.Query.GetRun("GETSECTORDATA:PiNumber").ToString();

if(value!="3.14")
    db.Query.Run("SETSECTORDATA:PiNumber:3.14");

//Or

MochaDatabase db = new MochaDatabase("path=.\\Databases\\Math.mochadb; AutoConnect=True");
MochaQuery query = new MochaQuery(db);
string value = query.GetRun("GETSECTORDATA:PiNumber").ToString();

if(value!="3.14")
    query.Run("SETSECTORDATA:PiNumber:3.14");



MochaScript

MochaScript is a scripting language for MochaDB databases.
It is processed by the debugger and executed with C# code.
It operates independently from the database, but no connection should be open to the targeted database when it is run!
It allows you to work with its own functions and MochaQ commands.

Use

//Author: Mertcan DAVULCU

//Connect.
//Provider "Path" or "Path" "Password"
Provider .\bin\Sources\MyDatabase.mochadb 1230

//Start script commands.
Begin

//Main function.
func Main()
{
    String PiNumber = ""
    SetPINumber()
    String PiNumber2 = PiNumber
    Boolean ExistsState = EXISTSSECTOR:PINumber

    if ExistsState == True
    {
        if GETSECTORDATA:PINumber == PiNumber2
        {
            DELETESECTOR:PINumber
        }
    }
    elif ExistsState == False
    {
        ADDSECTOR:PINumber:3.14:This is the pi number.
    }
    else
    {
        //Classical conditioning. "else" does not work because the elif meets "False" status.
        ADDSECTOR:PINumber:3.14:This is the pi number.
    }
}

func SetPINumber()
{
    PiNumber = "3.14"

    //Or.
    //delete PiNumber;
    //String PiNumber = "3.14"
}

// ******* COMPILER EVENTS *******

compilerevent OnFunctionInvoked()
{
    echo "Function called!"
}

//End script commands.
Final

Debugging

public void Debug(string path) {
    MochaScriptDebugger debugger = new MochaScriptDebugger(path);
    debugger.DebugRun();
}

Warnings
Documentation
NuGet Page

About

.NET embedded high performance NoSQL database system.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 91.2%
  • F# 3.2%
  • Shell 1.5%
  • PowerShell 1.5%
  • Batchfile 1.5%
  • Visual Basic .NET 0.9%
  • Makefile 0.2%