HamedMasafi / Nut

Advanced, Powerful and easy to use ORM for Qt
GNU Lesser General Public License v3.0
294 stars 75 forks source link

maintest.cpp:102: error: ‘class Nut::TableSet<Post>’ has no member named ‘createQuery’ #4

Closed xdien closed 7 years ago

xdien commented 7 years ago

I tried running the program but could not build. auto q = db.posts()->createQuery(); q->join(Post::commentsTable()); q->orderBy(!Post::saveDateField() & Post::bodyField()); q->setWhere(Post::idField() == postId); How can fix it? Thanks you

HamedMasafi commented 7 years ago

Can you please put full output?

xdien commented 7 years ago

Sorry for the late. All output here when I run tst_basic.pro

/home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp: In member function ‘void MainTest::selectPosts()’: /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp:102:26: error: ‘class Nut::TableSet’ has no member named ‘createQuery’ auto q = db.posts()->createQuery(); ^ /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp:104:39: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses] q->orderBy(!Post::saveDateField() & Post::bodyField()); ^ /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp: In member function ‘void MainTest::selectPostsWithoutTitle()’: /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp:124:26: error: ‘class Nut::TableSet’ has no member named ‘createQuery’ auto q = db.posts()->createQuery(); ^ In file included from /home/xdien/workspace/nhansu/Nut/src/database.h:28:0, from /home/xdien/workspace/nhansu/Nut/test/common/weblogdatabase.h:4, from /home/xdien/workspace/nhansu/Nut/test/basic/maintest.h:7, from /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp:7: /home/xdien/workspace/nhansu/Nut/test/basic/maintest.cpp: In member function ‘void MainTest::selectComments()’: /home/xdien/workspace/nhansu/Nut/src/defines.h:112:63: error: ‘class Nut::TableSet’ has no member named ‘createQuery’ https://pastebin.com/z0d6jBie

HamedMasafi commented 7 years ago

Sorry that is my mistake, createQuery() renamed to query(). I will push a new commit to correct tests (if you need so) within next 24hrs. Of course you can do a s/createQuery/query/g

xdien commented 7 years ago

I have changed some lines of code, I think it will make this library run more stable. Can you let me contribute it?

HamedMasafi commented 7 years ago

In the last commit syntax changes applied to maintest Some other changes is in my todo list, after that changes Nut will be stable enough to using in big applications.

I have changed some lines of code, I think it will make this library run more stable. Can you let me contribute it?

Absolutely yes. Make a fork and feel free to pull requests.

xdien commented 7 years ago

Thanks you very much!