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
This problem only happens if two tables have the same column name and a join is performed. Example:
struct User { uint32_t Id; std::string Name; ... }; struct OtherUser { uint32_t Id; std::string Name; std::string LastName; ... }; constexpr auto userStruct = sqlite_orm::struct_<UserStruct>(&User::Id, &User::Name, &OtherUser::LastName); auto orderBySql = sqlite_orm::dynamic_order_by(storage); switch (orderBy) { case Name: orderBySql.push_back(sqlite_orm::order_by(&User::Name).asc()) case LastName: orderBySql.push_back(sqlite_orm::order_by(&User::LastName).asc()) } auto users = storage.select( userStruct, sqlite_orm::left_join<OtherUser>( sqlite_orm::on(sqlite_orm::c(&User::Id) == &OtherUser::Id) ), orderBySql, sqlite_orm::limit(limitCount.value_or(-1)) );
If order by is Name, the generated query results in the error: Error while executing SQL query on database 'mydatabase': ambiguous column name: Name
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This problem only happens if two tables have the same column name and a join is performed.
Example:
If order by is Name, the generated query results in the error:
Error while executing SQL query on database 'mydatabase': ambiguous column name: Name
The text was updated successfully, but these errors were encountered: