Skip to content

Nisden/DbLite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DbLite

Build status

A simple micro ORM

Sample

// Start a transaction
using (new System.Transactions.TransactionScope())
{
    // Get a instance of IDbConnection, this can be SQLiteConnection, SQLConnection, etc
    using (var db = Fixture.Open())
    {
        var record = new SimpleTable
        {
            Interger1 = 22,
            String1 = "Hello! This is an insert"
        };
        db.Insert(record);

        record.String1 = "We just changed the text using an update!";
        db.Update(record);

        // Select all records where Interger1 is 22
        List<SimpleTable> records = db.Select<SimpleTable>("Interger1 = @Id", new { Id = 22 });

        // And now we just deleted all the records
        records.ForEach(x => db.Delete(x));
    }
}

Packages

  • NuGet DbLite
  • NuGet DbLite.MSSQL
  • NuGet DbLite.SQLite

Notes

  • Everything is parameterized, no inline variables
  • Currently there are only dialect providers for SQLite and MSSQL
  • Test coverage is spotty

Requirements

  • Visual Studio 2015 or newer
  • .NET 4.5.2

About

A small ORM targeted for SQLite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages