Go to file
Hamed Masafi ec449b0c8f all supported datatypes in full list markdown [skip ci] 2019-06-19 17:38:09 +04:30
3rdparty serializer updated to latest version [skip ci] 2019-06-19 11:27:49 +04:30
doc all supported datatypes in full list markdown [skip ci] 2019-06-19 17:38:09 +04:30
include Merge branch 'dev' into wip/shared_pointer 2019-06-19 11:31:46 +04:30
src #36 misspelling of "foreign" [skip ci] 2019-06-19 14:06:49 +04:30
test all supported datatypes in full list markdown [skip ci] 2019-06-19 17:38:09 +04:30
.gitignore data types test 2019-01-20 19:59:54 +03:30
.gitmodules wip:serializer 2019-02-07 19:22:57 +03:30
.travis.yml travis test 2019-06-08 16:46:25 +04:30
Doxyfile readme changes 2016-06-10 12:44:31 +04:30
LICENSE Initial commit 2016-03-09 11:05:49 +03:30
README.md all supported datatypes in full list markdown [skip ci] 2019-06-19 17:38:09 +04:30
appveyor.yml wip: phrases polish 2018-02-17 19:14:39 +03:30
btc-qr.png add donate button in readme [skip ci] 2018-10-15 18:05:40 +03:30
ci-test-init.pri wip: remove unneeded TableModel creation 2019-06-05 00:45:30 +04:30
nut-dynamic.pro created dynamic creation pro file [skip ci] 2019-02-28 13:08:28 +03:30
nut.pri working :-( [skip ci] 2019-06-18 20:07:03 +04:30
nut.pro initial 2019-06-18 18:10:40 +04:30
nut.qbs qbs file fixed 2018-07-14 17:07:53 +04:30
nut.qdocconf order phrase completed 2016-06-05 16:52:26 +04:30

README.md

Nut

Build result

Branch Status
master Build Status
dev Build Status

GitLicense

CodacyBadge

Advanced, Powerful and easy to use ORM for Qt5

Features:

  • Easy to use
  • Support PosgtreSQL, MySQL, SQLite and Microsoft Sql Server
  • Automatically create and update database
  • IDE auto complete support, No hard-code nedded
  • Table join detect
  • Supported types: Full list

Sample Codes

Read data from database:

auto q = db.posts()->createQuery();
q->setWhere(Post::idField() == postId);
auto posts = q->toList();
// now posts is a QList<Post*> contain all posts in
//  database that has id equal to postId variable
auto post = q->first();
// post is first row in database that its id is equal to postId

Adding to database:

Post *newPost = new Post;
newPost->setTitle("post title");

db.posts()->append(newPost);

for(int i = 0 ; i < 3; i++){
    Comment *comment = new Comment;
    comment->setMessage("comment #" + QString::number(i));

    newPost->comments()->append(comment);
}
db.saveChanges();

Modify database data:

auto q = db.posts()->createQuery();
q->setWhere(Post::idField() == postId);
Post *post = q->first();

if(post) {
    post->setTitle("new name");
    db.saveChanges();
} else {
    qWarning("No post found!");
}

Donate

Butcoin address: 1Dn1WHKkaxanXe4cTGDk4cFRRABxLUpEVj

Wallet addresst

For more information read Wiki.