We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I Found a problem in test.cpp according to #272 Visual Studio 2017
struct User { int id = 0; int age; std::string name; }; auto storage = make_storage("test.db", make_table("users", make_column("id", &User::id, primary_key()), make_column("age", &User::age), make_column("name", &User::name))); storage.sync_schema(); storage.replace(User{ 1, 15, "Jeremy" }); storage.replace(User{ 2, 16, "Nataly" }); storage.replace(User{ 3, 17, "Nataly" }); storage.replace(User{ 4, 18, "Nataly" }); storage.replace(User{ 5, 18, "Nataly" }); auto users = storage.get_all<User>(); cout << "users.size = 5 " << users.size() << endl; auto users6 = storage.get_all<User>( where( (false or c(&User::id) == 4) and (false or c(&User::age) == 18) )); cout << "users.size = 1 " << users6.size() << endl; for (auto &user : users6) { cout << storage.dump(user) << endl; }
The output is:
users.size = 5 5 users.size = 1 2 { id : '4', age : '18', name : 'Nataly' } { id : '5', age : '18', name : 'Nataly' }
It seems that the SQL where clause is:
WHERE ( ? OR 'users'."id" = ? AND ? OR 'users'."age" = ?)
but the correct should be:
WHERE ( (? OR 'users'."id" = ?) and (? or 'users'."age" = ?) )
Any advice? Thank you.
The text was updated successfully, but these errors were encountered:
Thanks. I shall inspect it soon
Sorry, something went wrong.
Fix is on it's way #385 Thank you
Fixed in #385 . Please check it out
Works great, thanks!
No branches or pull requests
I Found a problem in test.cpp according to #272
Visual Studio 2017
The output is:
It seems that the SQL where clause is:
but the correct should be:
Any advice? Thank you.
The text was updated successfully, but these errors were encountered: