Created
September 10, 2012 06:10
-
-
Save r2p2/3689171 to your computer and use it in GitHub Desktop.
reuse qsqlquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QSqlQuery prepare(const std::string &sql) | |
| { | |
| /* FIXME is working just once | |
| std::map<std::string, QSqlQuery>::iterator it = m_queries.find(sql); | |
| if(it == m_queries.end()) | |
| { | |
| m_queries[sql] = QSqlQuery(*m_db); | |
| m_queries[sql].prepare(sql.c_str()); | |
| } | |
| return m_queries[sql]; | |
| */ | |
| QSqlQuery query(*m_db); | |
| query.prepare(sql.c_str()); | |
| return query; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment