microrm2 ~master
Micro ORM for SQLite3
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Micro ORM for SQLite3
Very simple ORM with single backend (SQLite3).
struct Foo { ulong id; string text; ulong ts; }
struct Baz { string one; double two; }
struct Bar { ulong id; float value; Baz baz; }
enum schema = buildSchema!(Foo, Bar);
auto db = new MDatabase("test.db");
db.run(schema);
writeln("Bar count: ", db.count!Bar.run);
db.del!Foo.where("ts <", cts - cast(ulong)1e8).run;
db.insert(Foo(0, "hello", cts), Foo(20, "world", cts));
db.insert(Foo(0, "hello", cts), Foo(0, "world", cts));
db.insertOrReplace(Foo(1, "hello", cts), Foo(3, "world", cts));
See example/source/app.d
- Registered by redthing1
- ~master released a year ago
- redthing1/microrm2
- MIT
- Copyright © 2017, Oleg Butko
- Authors:
- Dependencies:
- d2sqlite3
- Versions:
-
0.8.3 2023-May-16 ~master 2023-May-16 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
25 downloads total
-
- Score:
- 0.3
- Short URL:
- microrm2.dub.pm