Sqlite on Windows (desktop/server)

To use Iridium with SQLite, the iridium.db.sqlite package is required in addition to the base Iridium package.

Using a SQLite database

The simplest way
var dbContext = new SqliteContext("my.db");

// ...

dbContext.CreateTable<Customer>();
//
dbContext.DataSet<Customer>().Save(new Customer { Name = "John" });
//
var johnCustomers = from c in dbContext.DataSet<Customer>()
                    where c.Name.StartsWith("John") 
                    select c;
Subclassing SqliteContext
public class DbContext : SqliteContext
{
     public DbContext() : base("my.db")
     {
     }

     public IDataSet<Customer> Customers {get;set;}
     public IDataSet<Product> Products {get;set;}
}

// ...

var dbContext = new DbContext();
//
dbContext.Customers.Save(new Customer { Name = "John" });
//
var johnCustomers = from c in dbContext.Customers 
                    where c.Name.StartsWith("John") 
                    select c;

You can also set the name of the database file later if you prefer (as long as you set it before the first data access):

public class DbContext : SqliteContext
{
     public IDataSet<Customer> Customers {get;set;}
     public IDataSet<Product> Products {get;set;}
}

// ...

var dbContext = new DbContext();

// ...

dbContext.FileName = "my.db";