I want to use a noSql database to store some data on local disk. I don’t want a WEB server, or to install any service database like MySQL/MSSQL Server, and no junk sql code like “select a.a, b.a from a inner join b…” messing with my code.
What could I use?
Have a look at scriptable objects, they are like data container objects. Should really be good enough for what you’re looking for.
Hi @KazYamof,
I’m the author of MarcelloDB (http://marcellodb.org) which is an embedded nosql database.
It should be a good fit for your use case.
Below is the example as for siaqodb, ported to marcellodb.
class MyDatabase
{
public class Foo
{
public int ID { get; set; }
public string Name { get; set; }
public int Age { get; set; }
public Foo (int id, string name, int age)
{
this.ID = id;
this.Age = age;
this.Name = name;
}
}
void Start ()
{
var dataPath = Application.dataPath + @"\databaseFolder";
var session = new MarcelloDB.Session(new MarcelloDB.netfx.Platform(), dataPath);
var foos = session["data"].Collection<Foo, int>("AllTheFoos", f => f.ID);
//persist
foos.Persist(new Foo(1, "Kaz", 26));
//enumerate
foreach(var f in foos){
}
//find individual item:
foos.find(1);
}
}