miniorm 0.0.3

A minimalistic ORM for SQLite


To use this package, run the following command in your project's root directory:

Mini ORM for SQLite3

Build Status

This is a simple ORM layer for d2sqlite3.

The architecture separate the database from the SQL tree construction. This is to make it possible to use as an ORM layer for other type of databases in the future.

Example

Very simple ORM with single backend (SQLite3).

    auto db = Miniorm("test.db");
    db.run(schema);

    db.run(delete_!Foo.where("ts <", Clock.currTime));

    db.run(insert!Foo, Foo(0, "hello", Clock.currTime), Foo(20, "world", Clock.currTime));
    db.run(insert!Foo, Foo(0, "hello", Clock.currTime), Foo(0, "world", Clock.currTime));

    import std.random : uniform;

    db.run(insert!Bar, Bar(0, uniform(0, 10), Baz("one", 3.14)));

    db.run(insertOrReplace!Foo, Foo(1, "hello", Clock.currTime), Foo(3, "world", Clock.currTime));

See example/source/app.d

Credit

Oleg Butko (deviator) for writing and publishing MicroORM which MiniORM is based on. Without MicroORM this library would not have seen the light of day.

Authors:
  • Joakim Brännström
Dependencies:
d2sqlite3, unit-threaded, sumtype
Versions:
0.0.3 2019-Sep-28
0.0.2 2019-Aug-08
0.0.1 2019-May-26
~master 2019-Oct-12
~setup-ci 2019-Aug-08
Show all 5 versions
Download Stats:
  • 0 downloads today

  • 2 downloads this week

  • 3 downloads this month

  • 6 downloads total

Score:
0.6
Short URL:
miniorm.dub.pm