Skip to content
morecraf edited this page Mar 12, 2021 · 3 revisions

Getting Started

In this quick-start you will find information to get you started using the Siaqodb - NoSQL embedded database for .NET.

Getting assemblies

The simplest way to get started is by using the nuget package. The package page will provide details on using nuget.

You can also manually download the entire package from the Siaqodb website download page. After you download the .zip file, simply unzip it and place the contents anywhere you want (Note: on some Windows systems, by default, all .zip files are blocked, to unblock it: right click on downloaded zip file->Properties->Unblock).

Add a Reference to Siaqodb DLLs If you are manually adding Siaqodb to your project, right click on the References folder in Visual Studio's Solution Explorer and select Add Reference.... Navigate to the folder where the DLLs were installed, choose from /bin folder the platform you are using and add DLLs from respective folder (example for .NET 4.5 platform):

Siaqodb.dll SiaqodbPortable.dll Platform considerations: Siaqodb assemblies are platform independent, however projects require platforms specific lmdb binaries. If you use Nuget packages, those binaries will be automatically placed into your /bin folder and no action is required.

Please review the Platform Specifics page for other specific settings you will have to set depending on the platform you are targeting.

Add Required using Statements As a minimum you will need the following using statements:

using Sqo;

Define storable classes:

Siaqodb stores class objects at its core. Please review the Supported types of members page to review details on what your objects can contain.

public class Employee
{
    public int OID { get; set; }  // note; setting an OID is not required and would happen behind the scenes if you omit it
    public Company Employer { get; set; }
    public string LastName { get; set; }
    public string FirstName { get; set; }
    public int Age { get; set; }
    public DateTime HireDate { get; set; }
    public string City { get; set; }
}

public class Company
{
    public int OID { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }
    public string Phone { get; set; }
}

Open/Create a database and store your objects:

Siaqodb siaqodb = new Siaqodb ("c:\Siaqodb\");
Company company = new Company();
company.Name = "MyCompany";
siaqodb.StoreObject(company);
Employee employee1 = new Employee();
employee1.Employer = company;
employee1.FirstName = "John";
employee1.LastName = "Walter";
siaqodb.StoreObject(employee1);

Retrieve objects from database: Example 1: get all companies from the database:

IObjectList<Company> companies = siaqodb.LoadAll<Company>();

Example 2: get all employees that FirstName contains "John"

var query = from Employee emp in siaqodb
                 where emp.FirstName.Contains("John")
                 select emp;
foreach (Employee emp in query)
{
    //do something with employee
}

Example 3: get all Employees that are over 30 years old and are from Berlin:

var query2 = from Employee emp in siaqodb
                  where emp.Age > 30 && emp.City == "Berlin"
                  select emp;
foreach (Employee emp in query2)
{
    //do something with emp
}

Example 4: get all Employees that work at "MyCompany" company:

var query3 = from Employee1 emp in siaqodb
                 where emp.Employer.Name == "MyCompany"
                 select new { emp.FirstName, emp.LastName };

For more examples, download Siaqodb setup and open the Examples projects included.

Next, we suggest you read more on any Platform Specifics for your target platforms. Browse the rest of the documentation topics to the left and see how powerful, yet simple Siaqodb can be for your projects!