-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
30 lines (22 loc) · 874 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Simple C++ ORM for SQLite v0.1.
Originally this was made to support simple cases in iOS games. For example storing scores.
The ORM supports foreign collections and lazy loading.
Released under New BSD license. See LICENSE file for more details.
=== Dependencies ===
- Sqlite3pp (included. see ext)
- boost.bind, boost.any and some other boost libraries
=== Usage ===
For basic usage information please see my blog post: http://alex.tapmania.org/2011/12/simple-sqlite-orm-for-c.html
and the example project included.
- Raw SQL
db_.execute(sql.c_str());
- Query with arguments
std::map<std::string, boost::any> a;
a[":score"] = 100000;
a[":user_id"] = user.get_id();
boost::shared_ptr<score> r = score_dao_obj.query_first(
"WHERE user_id = :user_id AND score >= :score", a);
if(score)
{
cout << "Found score higher than 100000 for user with the given ID.\n";
}