2
0

class_db.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.20"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: Db Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. <link href="custom_dark_theme.css" rel="stylesheet" type="text/css"/>
  21. </head>
  22. <body>
  23. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  24. <div id="titlearea">
  25. <table cellspacing="0" cellpadding="0">
  26. <tbody>
  27. <tr style="height: 56px;">
  28. <td id="projectalign" style="padding-left: 0.5em;">
  29. <div id="projectname">openPilotLog
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <!-- end header part -->
  37. <!-- Generated by Doxygen 1.8.20 -->
  38. <script type="text/javascript">
  39. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. /* @license-end */
  42. </script>
  43. <script type="text/javascript" src="menudata.js"></script>
  44. <script type="text/javascript" src="menu.js"></script>
  45. <script type="text/javascript">
  46. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  47. $(function() {
  48. initMenu('',true,false,'search.php','Search');
  49. $(document).ready(function() { init_search(); });
  50. });
  51. /* @license-end */</script>
  52. <div id="main-nav"></div>
  53. </div><!-- top -->
  54. <div id="side-nav" class="ui-resizable side-nav-resizable">
  55. <div id="nav-tree">
  56. <div id="nav-tree-contents">
  57. <div id="nav-sync" class="sync"></div>
  58. </div>
  59. </div>
  60. <div id="splitbar" style="-moz-user-select:none;"
  61. class="ui-resizable-handle">
  62. </div>
  63. </div>
  64. <script type="text/javascript">
  65. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  66. $(document).ready(function(){initNavTree('class_db.html',''); initResizable(); });
  67. /* @license-end */
  68. </script>
  69. <div id="doc-content">
  70. <!-- window showing the filter options -->
  71. <div id="MSearchSelectWindow"
  72. onmouseover="return searchBox.OnSearchSelectShow()"
  73. onmouseout="return searchBox.OnSearchSelectHide()"
  74. onkeydown="return searchBox.OnSearchSelectKey(event)">
  75. </div>
  76. <!-- iframe showing the search results (closed by default) -->
  77. <div id="MSearchResultsWindow">
  78. <iframe src="javascript:void(0)" frameborder="0"
  79. name="MSearchResults" id="MSearchResults">
  80. </iframe>
  81. </div>
  82. <div class="header">
  83. <div class="summary">
  84. <a href="#pub-types">Public Types</a> &#124;
  85. <a href="#pub-methods">Public Member Functions</a> &#124;
  86. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  87. <a href="class_db-members.html">List of all members</a> </div>
  88. <div class="headertitle">
  89. <div class="title">Db Class Reference</div> </div>
  90. </div><!--header-->
  91. <div class="contents">
  92. <p>The <a class="el" href="class_db.html" title="The Db class provides a basic API for accessing the database programatically. It is used to set up th...">Db</a> class provides a basic API for accessing the database programatically. It is used to set up the initial connection and various basic queries can be executed using a set of static functions. When interfacing with the database for the purpose of adding, deleting or updating entries, the use of the entry class and its subclasses is recommended. This clas is not supposed to be instantiated, if you need a database object, use QSqlDatabase::database("qt_sql_default_connection");.
  93. <a href="class_db.html#details">More...</a></p>
  94. <p><code>#include &lt;<a class="el" href="db_8h_source.html">db.h</a>&gt;</code></p>
  95. <table class="memberdecls">
  96. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
  97. Public Types</h2></td></tr>
  98. <tr class="memitem:a2eb74695b795bf25b6ddfd41c86bcc7b"><td class="memItemLeft" align="right" valign="top"><a id="a2eb74695b795bf25b6ddfd41c86bcc7b"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a2eb74695b795bf25b6ddfd41c86bcc7b">editRole</a> { <b>createNew</b>,
  99. <b>editExisting</b>
  100. }</td></tr>
  101. <tr class="memdesc:a2eb74695b795bf25b6ddfd41c86bcc7b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The editRole enum {createNew, editExisting} is used to differentiate between creating a new entry in the database vs editing an existing one. <br /></td></tr>
  102. <tr class="separator:a2eb74695b795bf25b6ddfd41c86bcc7b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:a8caadbd9713c345384823aa2f8cb951c"><td class="memItemLeft" align="right" valign="top"><a id="a8caadbd9713c345384823aa2f8cb951c"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">matchType</a> { <b>exactMatch</b>,
  104. <b>partialMatch</b>
  105. }</td></tr>
  106. <tr class="memdesc:a8caadbd9713c345384823aa2f8cb951c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The matchType enum {exactMatch, partialMatch} is used to determine the matching when using a WHERE sql statement. exactMatch results in a "=" operator, whereas partiasMatch results in a "LIKE" operator. <br /></td></tr>
  107. <tr class="separator:a8caadbd9713c345384823aa2f8cb951c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  108. </table><table class="memberdecls">
  109. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  110. Public Member Functions</h2></td></tr>
  111. <tr class="memitem:a5bc74f437d3ca0ebadcb13b185112e05"><td class="memItemLeft" align="right" valign="top"><a id="a5bc74f437d3ca0ebadcb13b185112e05"></a>
  112. &#160;</td><td class="memItemRight" valign="bottom"><b>Db</b> (<a class="el" href="class_db.html">Db</a> const &amp;)=delete</td></tr>
  113. <tr class="separator:a5bc74f437d3ca0ebadcb13b185112e05"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. <tr class="memitem:ad0724c898deb1e33d5d091a870b58d30"><td class="memItemLeft" align="right" valign="top"><a id="ad0724c898deb1e33d5d091a870b58d30"></a>
  115. void&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="class_db.html">Db</a> const &amp;)=delete</td></tr>
  116. <tr class="separator:ad0724c898deb1e33d5d091a870b58d30"><td class="memSeparator" colspan="2">&#160;</td></tr>
  117. </table><table class="memberdecls">
  118. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
  119. Static Public Member Functions</h2></td></tr>
  120. <tr class="memitem:ae50aad5630a4cc0f86b51bedb1f2d3f7"><td class="memItemLeft" align="right" valign="top"><a id="ae50aad5630a4cc0f86b51bedb1f2d3f7"></a>
  121. static <a class="el" href="class_db.html">Db</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>get</b> ()</td></tr>
  122. <tr class="separator:ae50aad5630a4cc0f86b51bedb1f2d3f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:af9dd776816e7941fec7b631eb2ff40b7"><td class="memItemLeft" align="right" valign="top"><a id="af9dd776816e7941fec7b631eb2ff40b7"></a>
  124. static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#af9dd776816e7941fec7b631eb2ff40b7">connect</a> ()</td></tr>
  125. <tr class="memdesc:af9dd776816e7941fec7b631eb2ff40b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">connect establishes the database connection. Only needs to be called once within the application. Database is available thereafter, objects can be instantiated with QSqlDatabase::database("qt_sql_default_connection") as required. <br /></td></tr>
  126. <tr class="separator:af9dd776816e7941fec7b631eb2ff40b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:a9bc721f0e6cd55a0dc4b6a690794f05a"><td class="memItemLeft" align="right" valign="top"><a id="a9bc721f0e6cd55a0dc4b6a690794f05a"></a>
  128. static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a9bc721f0e6cd55a0dc4b6a690794f05a">disconnect</a> ()</td></tr>
  129. <tr class="memdesc:a9bc721f0e6cd55a0dc4b6a690794f05a"><td class="mdescLeft">&#160;</td><td class="mdescRight">disconnect Closes and removes the default database connection. <br /></td></tr>
  130. <tr class="separator:a9bc721f0e6cd55a0dc4b6a690794f05a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:aca719513ddc25d3628761da143cfde9e"><td class="memItemLeft" align="right" valign="top">static QSqlDatabase&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#aca719513ddc25d3628761da143cfde9e">Database</a> ()</td></tr>
  132. <tr class="memdesc:aca719513ddc25d3628761da143cfde9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Can be used to access the database connection. <a href="class_db.html#aca719513ddc25d3628761da143cfde9e">More...</a><br /></td></tr>
  133. <tr class="separator:aca719513ddc25d3628761da143cfde9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  134. <tr class="memitem:a05ccd0af0703255fc249e5cb9e2eb945"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a05ccd0af0703255fc249e5cb9e2eb945">exists</a> (QString column, QString table, QString checkColumn, QString value, <a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a> match)</td></tr>
  135. <tr class="memdesc:a05ccd0af0703255fc249e5cb9e2eb945"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_db.html#a05ccd0af0703255fc249e5cb9e2eb945" title="Db::exists checks if a certain value exists in the database with a sqlite WHERE statement.">Db::exists</a> checks if a certain value exists in the database with a sqlite WHERE statement. <a href="class_db.html#a05ccd0af0703255fc249e5cb9e2eb945">More...</a><br /></td></tr>
  136. <tr class="separator:a05ccd0af0703255fc249e5cb9e2eb945"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:a939456015e76b398af918656791e3951"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a939456015e76b398af918656791e3951">singleUpdate</a> (QString table, QString column, QString value, QString checkColumn, QString checkvalue, <a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a> match)</td></tr>
  138. <tr class="memdesc:a939456015e76b398af918656791e3951"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_db.html#a939456015e76b398af918656791e3951" title="Db::singleUpdate Updates a single value in the database. Query format: UPDATE table SET column = valu...">Db::singleUpdate</a> Updates a single value in the database. Query format: UPDATE table SET column = value WHERE checkcolumn =/LIKE checkvalue. <a href="class_db.html#a939456015e76b398af918656791e3951">More...</a><br /></td></tr>
  139. <tr class="separator:a939456015e76b398af918656791e3951"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:addcbd285617f8ef82f79c276d7bddfe1"><td class="memItemLeft" align="right" valign="top">static QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#addcbd285617f8ef82f79c276d7bddfe1">singleSelect</a> (QString column, QString table, QString checkColumn, QString value, <a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a> match)</td></tr>
  141. <tr class="memdesc:addcbd285617f8ef82f79c276d7bddfe1"><td class="mdescLeft">&#160;</td><td class="mdescRight">singleSelect Returns a single value from the database with a sqlite WHERE statement <a href="class_db.html#addcbd285617f8ef82f79c276d7bddfe1">More...</a><br /></td></tr>
  142. <tr class="separator:addcbd285617f8ef82f79c276d7bddfe1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:a8dcb618ebfe1ae337bb0972bec37cbd2"><td class="memItemLeft" align="right" valign="top">static QVector&lt; QString &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2">multiSelect</a> (QVector&lt; QString &gt; columns, QString table, QString checkColumn, QString value, <a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a> match)</td></tr>
  144. <tr class="memdesc:a8dcb618ebfe1ae337bb0972bec37cbd2"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2" title="Db::multiSelect Returns multiple values from the database with a sqlite WHERE statement.">Db::multiSelect</a> Returns multiple values from the database with a sqlite WHERE statement. <a href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2">More...</a><br /></td></tr>
  145. <tr class="separator:a8dcb618ebfe1ae337bb0972bec37cbd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  146. <tr class="memitem:aa6c52eda14d37c9226b07e36fe6d0f86"><td class="memItemLeft" align="right" valign="top">static QVector&lt; QString &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#aa6c52eda14d37c9226b07e36fe6d0f86">multiSelect</a> (QVector&lt; QString &gt; columns, QString table)</td></tr>
  147. <tr class="memdesc:aa6c52eda14d37c9226b07e36fe6d0f86"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2" title="Db::multiSelect Returns multiple values from the database with a sqlite WHERE statement.">Db::multiSelect</a> Returns a complete column(s) for a given table. <a href="class_db.html#aa6c52eda14d37c9226b07e36fe6d0f86">More...</a><br /></td></tr>
  148. <tr class="separator:aa6c52eda14d37c9226b07e36fe6d0f86"><td class="memSeparator" colspan="2">&#160;</td></tr>
  149. <tr class="memitem:aaccb09bc96d531bbc7019a7df81859ca"><td class="memItemLeft" align="right" valign="top">static QVector&lt; QString &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_db.html#aaccb09bc96d531bbc7019a7df81859ca">customQuery</a> (QString query, int returnValues)</td></tr>
  150. <tr class="memdesc:aaccb09bc96d531bbc7019a7df81859ca"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_db.html#aaccb09bc96d531bbc7019a7df81859ca" title="Db::customQuery Can be used to send a complex query to the database.">Db::customQuery</a> Can be used to send a complex query to the database. <a href="class_db.html#aaccb09bc96d531bbc7019a7df81859ca">More...</a><br /></td></tr>
  151. <tr class="separator:aaccb09bc96d531bbc7019a7df81859ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
  152. </table>
  153. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  154. <div class="textblock"><p>The <a class="el" href="class_db.html" title="The Db class provides a basic API for accessing the database programatically. It is used to set up th...">Db</a> class provides a basic API for accessing the database programatically. It is used to set up the initial connection and various basic queries can be executed using a set of static functions. When interfacing with the database for the purpose of adding, deleting or updating entries, the use of the entry class and its subclasses is recommended. This clas is not supposed to be instantiated, if you need a database object, use QSqlDatabase::database("qt_sql_default_connection");. </p>
  155. </div><h2 class="groupheader">Member Function Documentation</h2>
  156. <a id="aaccb09bc96d531bbc7019a7df81859ca"></a>
  157. <h2 class="memtitle"><span class="permalink"><a href="#aaccb09bc96d531bbc7019a7df81859ca">&#9670;&nbsp;</a></span>customQuery()</h2>
  158. <div class="memitem">
  159. <div class="memproto">
  160. <table class="mlabels">
  161. <tr>
  162. <td class="mlabels-left">
  163. <table class="memname">
  164. <tr>
  165. <td class="memname">static QVector&lt;QString&gt; Db::customQuery </td>
  166. <td>(</td>
  167. <td class="paramtype">QString&#160;</td>
  168. <td class="paramname"><em>query</em>, </td>
  169. </tr>
  170. <tr>
  171. <td class="paramkey"></td>
  172. <td></td>
  173. <td class="paramtype">int&#160;</td>
  174. <td class="paramname"><em>returnValues</em>&#160;</td>
  175. </tr>
  176. <tr>
  177. <td></td>
  178. <td>)</td>
  179. <td></td><td></td>
  180. </tr>
  181. </table>
  182. </td>
  183. <td class="mlabels-right">
  184. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  185. </tr>
  186. </table>
  187. </div><div class="memdoc">
  188. <p><a class="el" href="class_db.html#aaccb09bc96d531bbc7019a7df81859ca" title="Db::customQuery Can be used to send a complex query to the database.">Db::customQuery</a> Can be used to send a complex query to the database. </p>
  189. <dl class="params"><dt>Parameters</dt><dd>
  190. <table class="params">
  191. <tr><td class="paramname">query</td><td>- the full sql query statement </td></tr>
  192. <tr><td class="paramname">returnValues</td><td>- the number of expected return values </td></tr>
  193. </table>
  194. </dd>
  195. </dl>
  196. <dl class="section return"><dt>Returns</dt><dd>QVector&lt;QString&gt; of results </dd></dl>
  197. </div>
  198. </div>
  199. <a id="aca719513ddc25d3628761da143cfde9e"></a>
  200. <h2 class="memtitle"><span class="permalink"><a href="#aca719513ddc25d3628761da143cfde9e">&#9670;&nbsp;</a></span>Database()</h2>
  201. <div class="memitem">
  202. <div class="memproto">
  203. <table class="mlabels">
  204. <tr>
  205. <td class="mlabels-left">
  206. <table class="memname">
  207. <tr>
  208. <td class="memname">static QSqlDatabase Db::Database </td>
  209. <td>(</td>
  210. <td class="paramname"></td><td>)</td>
  211. <td></td>
  212. </tr>
  213. </table>
  214. </td>
  215. <td class="mlabels-right">
  216. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  217. </tr>
  218. </table>
  219. </div><div class="memdoc">
  220. <p>Can be used to access the database connection. </p>
  221. <dl class="section return"><dt>Returns</dt><dd>a pointer to the default database connection </dd></dl>
  222. </div>
  223. </div>
  224. <a id="a05ccd0af0703255fc249e5cb9e2eb945"></a>
  225. <h2 class="memtitle"><span class="permalink"><a href="#a05ccd0af0703255fc249e5cb9e2eb945">&#9670;&nbsp;</a></span>exists()</h2>
  226. <div class="memitem">
  227. <div class="memproto">
  228. <table class="mlabels">
  229. <tr>
  230. <td class="mlabels-left">
  231. <table class="memname">
  232. <tr>
  233. <td class="memname">static bool Db::exists </td>
  234. <td>(</td>
  235. <td class="paramtype">QString&#160;</td>
  236. <td class="paramname"><em>column</em>, </td>
  237. </tr>
  238. <tr>
  239. <td class="paramkey"></td>
  240. <td></td>
  241. <td class="paramtype">QString&#160;</td>
  242. <td class="paramname"><em>table</em>, </td>
  243. </tr>
  244. <tr>
  245. <td class="paramkey"></td>
  246. <td></td>
  247. <td class="paramtype">QString&#160;</td>
  248. <td class="paramname"><em>checkColumn</em>, </td>
  249. </tr>
  250. <tr>
  251. <td class="paramkey"></td>
  252. <td></td>
  253. <td class="paramtype">QString&#160;</td>
  254. <td class="paramname"><em>value</em>, </td>
  255. </tr>
  256. <tr>
  257. <td class="paramkey"></td>
  258. <td></td>
  259. <td class="paramtype"><a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a>&#160;</td>
  260. <td class="paramname"><em>match</em>&#160;</td>
  261. </tr>
  262. <tr>
  263. <td></td>
  264. <td>)</td>
  265. <td></td><td></td>
  266. </tr>
  267. </table>
  268. </td>
  269. <td class="mlabels-right">
  270. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  271. </tr>
  272. </table>
  273. </div><div class="memdoc">
  274. <p><a class="el" href="class_db.html#a05ccd0af0703255fc249e5cb9e2eb945" title="Db::exists checks if a certain value exists in the database with a sqlite WHERE statement.">Db::exists</a> checks if a certain value exists in the database with a sqlite WHERE statement. </p>
  275. <dl class="params"><dt>Parameters</dt><dd>
  276. <table class="params">
  277. <tr><td class="paramname">table</td><td>- Name of the table </td></tr>
  278. <tr><td class="paramname">column</td><td>- Name of the column </td></tr>
  279. <tr><td class="paramname">value</td><td>- The value to be checked </td></tr>
  280. </table>
  281. </dd>
  282. </dl>
  283. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  284. </div>
  285. </div>
  286. <a id="aa6c52eda14d37c9226b07e36fe6d0f86"></a>
  287. <h2 class="memtitle"><span class="permalink"><a href="#aa6c52eda14d37c9226b07e36fe6d0f86">&#9670;&nbsp;</a></span>multiSelect() <span class="overload">[1/2]</span></h2>
  288. <div class="memitem">
  289. <div class="memproto">
  290. <table class="mlabels">
  291. <tr>
  292. <td class="mlabels-left">
  293. <table class="memname">
  294. <tr>
  295. <td class="memname">static QVector&lt;QString&gt; Db::multiSelect </td>
  296. <td>(</td>
  297. <td class="paramtype">QVector&lt; QString &gt;&#160;</td>
  298. <td class="paramname"><em>columns</em>, </td>
  299. </tr>
  300. <tr>
  301. <td class="paramkey"></td>
  302. <td></td>
  303. <td class="paramtype">QString&#160;</td>
  304. <td class="paramname"><em>table</em>&#160;</td>
  305. </tr>
  306. <tr>
  307. <td></td>
  308. <td>)</td>
  309. <td></td><td></td>
  310. </tr>
  311. </table>
  312. </td>
  313. <td class="mlabels-right">
  314. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  315. </tr>
  316. </table>
  317. </div><div class="memdoc">
  318. <p><a class="el" href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2" title="Db::multiSelect Returns multiple values from the database with a sqlite WHERE statement.">Db::multiSelect</a> Returns a complete column(s) for a given table. </p>
  319. <dl class="params"><dt>Parameters</dt><dd>
  320. <table class="params">
  321. <tr><td class="paramname">column</td><td>- QVector&lt;QString&gt; Names of the columns to be queried </td></tr>
  322. <tr><td class="paramname">table</td><td>- QString Name of the table </td></tr>
  323. </table>
  324. </dd>
  325. </dl>
  326. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  327. </div>
  328. </div>
  329. <a id="a8dcb618ebfe1ae337bb0972bec37cbd2"></a>
  330. <h2 class="memtitle"><span class="permalink"><a href="#a8dcb618ebfe1ae337bb0972bec37cbd2">&#9670;&nbsp;</a></span>multiSelect() <span class="overload">[2/2]</span></h2>
  331. <div class="memitem">
  332. <div class="memproto">
  333. <table class="mlabels">
  334. <tr>
  335. <td class="mlabels-left">
  336. <table class="memname">
  337. <tr>
  338. <td class="memname">static QVector&lt;QString&gt; Db::multiSelect </td>
  339. <td>(</td>
  340. <td class="paramtype">QVector&lt; QString &gt;&#160;</td>
  341. <td class="paramname"><em>columns</em>, </td>
  342. </tr>
  343. <tr>
  344. <td class="paramkey"></td>
  345. <td></td>
  346. <td class="paramtype">QString&#160;</td>
  347. <td class="paramname"><em>table</em>, </td>
  348. </tr>
  349. <tr>
  350. <td class="paramkey"></td>
  351. <td></td>
  352. <td class="paramtype">QString&#160;</td>
  353. <td class="paramname"><em>checkColumn</em>, </td>
  354. </tr>
  355. <tr>
  356. <td class="paramkey"></td>
  357. <td></td>
  358. <td class="paramtype">QString&#160;</td>
  359. <td class="paramname"><em>value</em>, </td>
  360. </tr>
  361. <tr>
  362. <td class="paramkey"></td>
  363. <td></td>
  364. <td class="paramtype"><a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a>&#160;</td>
  365. <td class="paramname"><em>match</em>&#160;</td>
  366. </tr>
  367. <tr>
  368. <td></td>
  369. <td>)</td>
  370. <td></td><td></td>
  371. </tr>
  372. </table>
  373. </td>
  374. <td class="mlabels-right">
  375. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  376. </tr>
  377. </table>
  378. </div><div class="memdoc">
  379. <p><a class="el" href="class_db.html#a8dcb618ebfe1ae337bb0972bec37cbd2" title="Db::multiSelect Returns multiple values from the database with a sqlite WHERE statement.">Db::multiSelect</a> Returns multiple values from the database with a sqlite WHERE statement. </p>
  380. <dl class="params"><dt>Parameters</dt><dd>
  381. <table class="params">
  382. <tr><td class="paramname">table</td><td>- Name of the table </td></tr>
  383. <tr><td class="paramname">columns</td><td>- QVector&lt;QString&gt; Names of the columns to be queried </td></tr>
  384. <tr><td class="paramname">value</td><td>- Identifier for WHERE statement </td></tr>
  385. <tr><td class="paramname">checkColumn</td><td>- column to match value to </td></tr>
  386. <tr><td class="paramname">match</td><td>- enum Db::exactMatch or Db::partialMatch </td></tr>
  387. </table>
  388. </dd>
  389. </dl>
  390. <dl class="section return"><dt>Returns</dt><dd>QVector&lt;QString&gt; </dd></dl>
  391. </div>
  392. </div>
  393. <a id="addcbd285617f8ef82f79c276d7bddfe1"></a>
  394. <h2 class="memtitle"><span class="permalink"><a href="#addcbd285617f8ef82f79c276d7bddfe1">&#9670;&nbsp;</a></span>singleSelect()</h2>
  395. <div class="memitem">
  396. <div class="memproto">
  397. <table class="mlabels">
  398. <tr>
  399. <td class="mlabels-left">
  400. <table class="memname">
  401. <tr>
  402. <td class="memname">static QString Db::singleSelect </td>
  403. <td>(</td>
  404. <td class="paramtype">QString&#160;</td>
  405. <td class="paramname"><em>column</em>, </td>
  406. </tr>
  407. <tr>
  408. <td class="paramkey"></td>
  409. <td></td>
  410. <td class="paramtype">QString&#160;</td>
  411. <td class="paramname"><em>table</em>, </td>
  412. </tr>
  413. <tr>
  414. <td class="paramkey"></td>
  415. <td></td>
  416. <td class="paramtype">QString&#160;</td>
  417. <td class="paramname"><em>checkColumn</em>, </td>
  418. </tr>
  419. <tr>
  420. <td class="paramkey"></td>
  421. <td></td>
  422. <td class="paramtype">QString&#160;</td>
  423. <td class="paramname"><em>value</em>, </td>
  424. </tr>
  425. <tr>
  426. <td class="paramkey"></td>
  427. <td></td>
  428. <td class="paramtype"><a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a>&#160;</td>
  429. <td class="paramname"><em>match</em>&#160;</td>
  430. </tr>
  431. <tr>
  432. <td></td>
  433. <td>)</td>
  434. <td></td><td></td>
  435. </tr>
  436. </table>
  437. </td>
  438. <td class="mlabels-right">
  439. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  440. </tr>
  441. </table>
  442. </div><div class="memdoc">
  443. <p>singleSelect Returns a single value from the database with a sqlite WHERE statement </p>
  444. <dl class="params"><dt>Parameters</dt><dd>
  445. <table class="params">
  446. <tr><td class="paramname">table</td><td>- Name of the table </td></tr>
  447. <tr><td class="paramname">column</td><td>- Name of the column </td></tr>
  448. <tr><td class="paramname">value</td><td>- Identifier for WHERE statement </td></tr>
  449. <tr><td class="paramname">match</td><td>- enum Db::exactMatch or Db::partialMatch </td></tr>
  450. </table>
  451. </dd>
  452. </dl>
  453. <dl class="section return"><dt>Returns</dt><dd>QString </dd></dl>
  454. </div>
  455. </div>
  456. <a id="a939456015e76b398af918656791e3951"></a>
  457. <h2 class="memtitle"><span class="permalink"><a href="#a939456015e76b398af918656791e3951">&#9670;&nbsp;</a></span>singleUpdate()</h2>
  458. <div class="memitem">
  459. <div class="memproto">
  460. <table class="mlabels">
  461. <tr>
  462. <td class="mlabels-left">
  463. <table class="memname">
  464. <tr>
  465. <td class="memname">static bool Db::singleUpdate </td>
  466. <td>(</td>
  467. <td class="paramtype">QString&#160;</td>
  468. <td class="paramname"><em>table</em>, </td>
  469. </tr>
  470. <tr>
  471. <td class="paramkey"></td>
  472. <td></td>
  473. <td class="paramtype">QString&#160;</td>
  474. <td class="paramname"><em>column</em>, </td>
  475. </tr>
  476. <tr>
  477. <td class="paramkey"></td>
  478. <td></td>
  479. <td class="paramtype">QString&#160;</td>
  480. <td class="paramname"><em>value</em>, </td>
  481. </tr>
  482. <tr>
  483. <td class="paramkey"></td>
  484. <td></td>
  485. <td class="paramtype">QString&#160;</td>
  486. <td class="paramname"><em>checkColumn</em>, </td>
  487. </tr>
  488. <tr>
  489. <td class="paramkey"></td>
  490. <td></td>
  491. <td class="paramtype">QString&#160;</td>
  492. <td class="paramname"><em>checkvalue</em>, </td>
  493. </tr>
  494. <tr>
  495. <td class="paramkey"></td>
  496. <td></td>
  497. <td class="paramtype"><a class="el" href="class_db.html#a8caadbd9713c345384823aa2f8cb951c">Db::matchType</a>&#160;</td>
  498. <td class="paramname"><em>match</em>&#160;</td>
  499. </tr>
  500. <tr>
  501. <td></td>
  502. <td>)</td>
  503. <td></td><td></td>
  504. </tr>
  505. </table>
  506. </td>
  507. <td class="mlabels-right">
  508. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  509. </tr>
  510. </table>
  511. </div><div class="memdoc">
  512. <p><a class="el" href="class_db.html#a939456015e76b398af918656791e3951" title="Db::singleUpdate Updates a single value in the database. Query format: UPDATE table SET column = valu...">Db::singleUpdate</a> Updates a single value in the database. Query format: UPDATE table SET column = value WHERE checkcolumn =/LIKE checkvalue. </p>
  513. <dl class="params"><dt>Parameters</dt><dd>
  514. <table class="params">
  515. <tr><td class="paramname">table</td><td>Name of the table to be updated </td></tr>
  516. <tr><td class="paramname">column</td><td>Name of the column to be updated </td></tr>
  517. <tr><td class="paramname">checkColumn</td><td>Name of the column for WHERE statement </td></tr>
  518. <tr><td class="paramname">value</td><td>The value to be set </td></tr>
  519. <tr><td class="paramname">checkvalue</td><td>The value for the WHERE statement </td></tr>
  520. <tr><td class="paramname">match</td><td>enum Db::exactMatch or Db::partialMatch </td></tr>
  521. </table>
  522. </dd>
  523. </dl>
  524. <dl class="section return"><dt>Returns</dt><dd>true on success, otherwise error messages in debug out </dd></dl>
  525. </div>
  526. </div>
  527. <hr/>The documentation for this class was generated from the following files:<ul>
  528. <li>src/database/<a class="el" href="db_8h_source.html">db.h</a></li>
  529. <li>src/database/db.cpp</li>
  530. </ul>
  531. </div><!-- contents -->
  532. </div><!-- doc-content -->
  533. <!-- start footer part -->
  534. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  535. <ul>
  536. <li class="navelem"><a class="el" href="class_db.html">Db</a></li>
  537. <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  538. </ul>
  539. </div>
  540. </body>
  541. </html>