class_o_p_l_1_1_database.html 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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.9.1"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>openPilotLog: OPL::Database 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="projectlogo"><img alt="Logo" src="icon_main.png"/></td>
  29. <td id="projectalign" style="padding-left: 0.5em;">
  30. <div id="projectname">openPilotLog
  31. </div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.9.1 -->
  39. <script type="text/javascript">
  40. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  41. var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
  42. /* @license-end */
  43. </script>
  44. <script type="text/javascript" src="menudata.js"></script>
  45. <script type="text/javascript" src="menu.js"></script>
  46. <script type="text/javascript">
  47. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  48. $(function() {
  49. initMenu('',true,false,'search.php','Search');
  50. $(document).ready(function() { init_search(); });
  51. });
  52. /* @license-end */</script>
  53. <div id="main-nav"></div>
  54. </div><!-- top -->
  55. <div id="side-nav" class="ui-resizable side-nav-resizable">
  56. <div id="nav-tree">
  57. <div id="nav-tree-contents">
  58. <div id="nav-sync" class="sync"></div>
  59. </div>
  60. </div>
  61. <div id="splitbar" style="-moz-user-select:none;"
  62. class="ui-resizable-handle">
  63. </div>
  64. </div>
  65. <script type="text/javascript">
  66. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  67. $(document).ready(function(){initNavTree('class_o_p_l_1_1_database.html',''); initResizable(); });
  68. /* @license-end */
  69. </script>
  70. <div id="doc-content">
  71. <!-- window showing the filter options -->
  72. <div id="MSearchSelectWindow"
  73. onmouseover="return searchBox.OnSearchSelectShow()"
  74. onmouseout="return searchBox.OnSearchSelectHide()"
  75. onkeydown="return searchBox.OnSearchSelectKey(event)">
  76. </div>
  77. <!-- iframe showing the search results (closed by default) -->
  78. <div id="MSearchResultsWindow">
  79. <iframe src="javascript:void(0)" frameborder="0"
  80. name="MSearchResults" id="MSearchResults">
  81. </iframe>
  82. </div>
  83. <div class="header">
  84. <div class="summary">
  85. <a href="#signals">Signals</a> &#124;
  86. <a href="#pub-methods">Public Member Functions</a> &#124;
  87. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  88. <a href="#pub-attribs">Public Attributes</a> &#124;
  89. <a href="class_o_p_l_1_1_database-members.html">List of all members</a> </div>
  90. <div class="headertitle">
  91. <div class="title">OPL::Database Class Reference</div> </div>
  92. </div><!--header-->
  93. <div class="contents">
  94. <p>The DB class encapsulates the SQL database by providing fast access to hot database data.
  95. <a href="class_o_p_l_1_1_database.html#details">More...</a></p>
  96. <p><code>#include &lt;<a class="el" href="database_8h_source.html">database.h</a>&gt;</code></p>
  97. <div class="dynheader">
  98. Inheritance diagram for OPL::Database:</div>
  99. <div class="dyncontent">
  100. <div class="center">
  101. <img src="class_o_p_l_1_1_database.png" alt=""/>
  102. </div></div>
  103. <table class="memberdecls">
  104. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="signals"></a>
  105. Signals</h2></td></tr>
  106. <tr class="memitem:a8e99ff7cf4173ca1a87ede9acc02be00"><td class="memItemLeft" align="right" valign="top"><a id="a8e99ff7cf4173ca1a87ede9acc02be00"></a>
  107. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a8e99ff7cf4173ca1a87ede9acc02be00">dataBaseUpdated</a> (const <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">DbTable</a> table)</td></tr>
  108. <tr class="memdesc:a8e99ff7cf4173ca1a87ede9acc02be00"><td class="mdescLeft">&#160;</td><td class="mdescRight">updated is emitted whenever the database contents have been updated. This can be either a commit, update or remove. This signal should be used to trigger an update to the models of the views displaying database contents in the user interface so that a user is always presented with up-to-date information. <br /></td></tr>
  109. <tr class="separator:a8e99ff7cf4173ca1a87ede9acc02be00"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:acc87b25e9ab6a6a6dce1883821292882"><td class="memItemLeft" align="right" valign="top"><a id="acc87b25e9ab6a6a6dce1883821292882"></a>
  111. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#acc87b25e9ab6a6a6dce1883821292882">connectionReset</a> ()</td></tr>
  112. <tr class="memdesc:acc87b25e9ab6a6a6dce1883821292882"><td class="mdescLeft">&#160;</td><td class="mdescRight">connectionReset is emitted whenever the database connection is reset, for example when creating or restoring a backup. <br /></td></tr>
  113. <tr class="separator:acc87b25e9ab6a6a6dce1883821292882"><td class="memSeparator" colspan="2">&#160;</td></tr>
  114. </table><table class="memberdecls">
  115. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  116. Public Member Functions</h2></td></tr>
  117. <tr class="memitem:a040073e7620277891f4ab4de81bca9f4"><td class="memItemLeft" align="right" valign="top"><a id="a040073e7620277891f4ab4de81bca9f4"></a>
  118. &#160;</td><td class="memItemRight" valign="bottom"><b>Database</b> (const <a class="el" href="class_o_p_l_1_1_database.html">Database</a> &amp;)=delete</td></tr>
  119. <tr class="separator:a040073e7620277891f4ab4de81bca9f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. <tr class="memitem:a039830b539f0c81be67ec6796dded105"><td class="memItemLeft" align="right" valign="top"><a id="a039830b539f0c81be67ec6796dded105"></a>
  121. void&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="class_o_p_l_1_1_database.html">Database</a> &amp;)=delete</td></tr>
  122. <tr class="separator:a039830b539f0c81be67ec6796dded105"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:a15dbcef162931776a0bdf6610fdd4cde"><td class="memItemLeft" align="right" valign="top"><a id="a15dbcef162931776a0bdf6610fdd4cde"></a>
  124. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a15dbcef162931776a0bdf6610fdd4cde">connect</a> ()</td></tr>
  125. <tr class="memdesc:a15dbcef162931776a0bdf6610fdd4cde"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to the database and populate database information. <br /></td></tr>
  126. <tr class="separator:a15dbcef162931776a0bdf6610fdd4cde"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:aceb1bb497d30d413f87d6541716a873b"><td class="memItemLeft" align="right" valign="top"><a id="aceb1bb497d30d413f87d6541716a873b"></a>
  128. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aceb1bb497d30d413f87d6541716a873b">disconnect</a> ()</td></tr>
  129. <tr class="memdesc:aceb1bb497d30d413f87d6541716a873b"><td class="mdescLeft">&#160;</td><td class="mdescRight">closes the database connection. <br /></td></tr>
  130. <tr class="separator:aceb1bb497d30d413f87d6541716a873b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  131. <tr class="memitem:a55a01dac1e447f7c41474a39d8f621ef"><td class="memItemLeft" align="right" valign="top"><a id="a55a01dac1e447f7c41474a39d8f621ef"></a>
  132. void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a55a01dac1e447f7c41474a39d8f621ef">updateLayout</a> ()</td></tr>
  133. <tr class="memdesc:a55a01dac1e447f7c41474a39d8f621ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the member variables tableNames and tableColumns with up-to-date layout information if the database has been altered. This function is normally only required during database setup or maintenance. <br /></td></tr>
  134. <tr class="separator:a55a01dac1e447f7c41474a39d8f621ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a6df6e6b98679011f747862ca48a3498c"><td class="memItemLeft" align="right" valign="top"><a id="a6df6e6b98679011f747862ca48a3498c"></a>
  136. const QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a6df6e6b98679011f747862ca48a3498c">version</a> () const</td></tr>
  137. <tr class="memdesc:a6df6e6b98679011f747862ca48a3498c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the database revision number (not the sqlite version number). <br /></td></tr>
  138. <tr class="separator:a6df6e6b98679011f747862ca48a3498c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:a0b20bec0f8bef0277325492a1dee33ef"><td class="memItemLeft" align="right" valign="top">const QString&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef">sqliteVersion</a> () const</td></tr>
  140. <tr class="memdesc:a0b20bec0f8bef0277325492a1dee33ef"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef" title="Database::sqliteVersion returns the database sqlite version. See also dbRevision()">Database::sqliteVersion</a> returns the database sqlite version. See also dbRevision() <a href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef">More...</a><br /></td></tr>
  141. <tr class="separator:a0b20bec0f8bef0277325492a1dee33ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. <tr class="memitem:a9d09969956b08b86bf83277872354247"><td class="memItemLeft" align="right" valign="top"><a id="a9d09969956b08b86bf83277872354247"></a>
  143. const QStringList&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a9d09969956b08b86bf83277872354247">getTableNames</a> () const</td></tr>
  144. <tr class="memdesc:a9d09969956b08b86bf83277872354247"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the names of all tables in the database. <br /></td></tr>
  145. <tr class="separator:a9d09969956b08b86bf83277872354247"><td class="memSeparator" colspan="2">&#160;</td></tr>
  146. <tr class="memitem:ac5b344097eeb2579da9bcfc7941d074c"><td class="memItemLeft" align="right" valign="top"><a id="ac5b344097eeb2579da9bcfc7941d074c"></a>
  147. const QStringList&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#ac5b344097eeb2579da9bcfc7941d074c">getTableColumns</a> (<a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table_name) const</td></tr>
  148. <tr class="memdesc:ac5b344097eeb2579da9bcfc7941d074c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the names of a given table in the database. <br /></td></tr>
  149. <tr class="separator:ac5b344097eeb2579da9bcfc7941d074c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. <tr class="memitem:abf45cf7ba5d25bb5d8f8aac1105bb728"><td class="memItemLeft" align="right" valign="top">QVector&lt; QVariant &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#abf45cf7ba5d25bb5d8f8aac1105bb728">customQuery</a> (QString statement, int return_values)</td></tr>
  151. <tr class="memdesc:abf45cf7ba5d25bb5d8f8aac1105bb728"><td class="mdescLeft">&#160;</td><td class="mdescRight">Can be used to send a complex query to the database. <a href="class_o_p_l_1_1_database.html#abf45cf7ba5d25bb5d8f8aac1105bb728">More...</a><br /></td></tr>
  152. <tr class="separator:abf45cf7ba5d25bb5d8f8aac1105bb728"><td class="memSeparator" colspan="2">&#160;</td></tr>
  153. <tr class="memitem:a69f4a4fa1e496e86224e87612edba548"><td class="memItemLeft" align="right" valign="top"><a id="a69f4a4fa1e496e86224e87612edba548"></a>
  154. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a69f4a4fa1e496e86224e87612edba548">exists</a> (const <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a> &amp;row)</td></tr>
  155. <tr class="memdesc:a69f4a4fa1e496e86224e87612edba548"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if an entry exists in the database, based on position data. <br /></td></tr>
  156. <tr class="separator:a69f4a4fa1e496e86224e87612edba548"><td class="memSeparator" colspan="2">&#160;</td></tr>
  157. <tr class="memitem:aa342b9d852daecb85fb77ec2f19234a5"><td class="memItemLeft" align="right" valign="top"><a id="aa342b9d852daecb85fb77ec2f19234a5"></a>
  158. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aa342b9d852daecb85fb77ec2f19234a5">clear</a> ()</td></tr>
  159. <tr class="memdesc:aa342b9d852daecb85fb77ec2f19234a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">clear resets the database, i.e. deletes all content in the tables containing userdata (pilots, flights, tails) <br /></td></tr>
  160. <tr class="separator:aa342b9d852daecb85fb77ec2f19234a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  161. <tr class="memitem:ad9aab9c8bc43009bbc2595409004e20b"><td class="memItemLeft" align="right" valign="top"><a id="ad9aab9c8bc43009bbc2595409004e20b"></a>
  162. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#ad9aab9c8bc43009bbc2595409004e20b">commit</a> (const <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a> &amp;row)</td></tr>
  163. <tr class="memdesc:ad9aab9c8bc43009bbc2595409004e20b"><td class="mdescLeft">&#160;</td><td class="mdescRight">commits an entry to the database, calls either insert or update, based on position data <br /></td></tr>
  164. <tr class="separator:ad9aab9c8bc43009bbc2595409004e20b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  165. <tr class="memitem:aa83b4d2d9cc2f9e24aaae6a25df829f2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aa83b4d2d9cc2f9e24aaae6a25df829f2">commit</a> (const QJsonArray &amp;json_arr, const <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table)</td></tr>
  166. <tr class="memdesc:aa83b4d2d9cc2f9e24aaae6a25df829f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">commits data imported from JSON <a href="class_o_p_l_1_1_database.html#aa83b4d2d9cc2f9e24aaae6a25df829f2">More...</a><br /></td></tr>
  167. <tr class="separator:aa83b4d2d9cc2f9e24aaae6a25df829f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  168. <tr class="memitem:aa3bbfc0dd7ff7bd34c2c1c847f539168"><td class="memItemLeft" align="right" valign="top"><a id="aa3bbfc0dd7ff7bd34c2c1c847f539168"></a>
  169. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aa3bbfc0dd7ff7bd34c2c1c847f539168">insert</a> (const <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a> &amp;new_row)</td></tr>
  170. <tr class="memdesc:aa3bbfc0dd7ff7bd34c2c1c847f539168"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create new entry in the databse based on UserInput. <br /></td></tr>
  171. <tr class="separator:aa3bbfc0dd7ff7bd34c2c1c847f539168"><td class="memSeparator" colspan="2">&#160;</td></tr>
  172. <tr class="memitem:a4938319e593b9e5d5a334f794301d873"><td class="memItemLeft" align="right" valign="top"><a id="a4938319e593b9e5d5a334f794301d873"></a>
  173. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a4938319e593b9e5d5a334f794301d873">update</a> (const <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a> &amp;updated_row)</td></tr>
  174. <tr class="memdesc:a4938319e593b9e5d5a334f794301d873"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates entry in database from existing entry tweaked by the user. <br /></td></tr>
  175. <tr class="separator:a4938319e593b9e5d5a334f794301d873"><td class="memSeparator" colspan="2">&#160;</td></tr>
  176. <tr class="memitem:a29362ea9a2b1805d42e5ef7823c42e50"><td class="memItemLeft" align="right" valign="top"><a id="a29362ea9a2b1805d42e5ef7823c42e50"></a>
  177. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a29362ea9a2b1805d42e5ef7823c42e50">remove</a> (const <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a> &amp;row)</td></tr>
  178. <tr class="memdesc:a29362ea9a2b1805d42e5ef7823c42e50"><td class="mdescLeft">&#160;</td><td class="mdescRight">deletes an entry from the database. <br /></td></tr>
  179. <tr class="separator:a29362ea9a2b1805d42e5ef7823c42e50"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:a6c2ebefc6cf6d948d64dfe71bec08540"><td class="memItemLeft" align="right" valign="top"><a id="a6c2ebefc6cf6d948d64dfe71bec08540"></a>
  181. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a6c2ebefc6cf6d948d64dfe71bec08540">removeMany</a> (<a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, const QList&lt; int &gt; &amp;row_id_list)</td></tr>
  182. <tr class="memdesc:a6c2ebefc6cf6d948d64dfe71bec08540"><td class="mdescLeft">&#160;</td><td class="mdescRight">deletes a batch of entries from the database. Optimised for speed when deleting many entries. The entries are identified using their row id <br /></td></tr>
  183. <tr class="separator:a6c2ebefc6cf6d948d64dfe71bec08540"><td class="memSeparator" colspan="2">&#160;</td></tr>
  184. <tr class="memitem:ae38dc30cb955ffc0e3235e51104dd912"><td class="memItemLeft" align="right" valign="top"><a id="ae38dc30cb955ffc0e3235e51104dd912"></a>
  185. <a class="el" href="class_o_p_l_1_1_row.html">OPL::Row</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#ae38dc30cb955ffc0e3235e51104dd912">getRow</a> (const <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, const int row_id)</td></tr>
  186. <tr class="memdesc:ae38dc30cb955ffc0e3235e51104dd912"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreive a <a class="el" href="class_o_p_l_1_1_row.html" title="The Row class provides an interface for retreiving and submitting entries from the database.">Row</a> from the database <br /></td></tr>
  187. <tr class="separator:ae38dc30cb955ffc0e3235e51104dd912"><td class="memSeparator" colspan="2">&#160;</td></tr>
  188. <tr class="memitem:a3657d55721b0d3599ce6df55120017de"><td class="memItemLeft" align="right" valign="top"><a id="a3657d55721b0d3599ce6df55120017de"></a>
  189. RowData_T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a3657d55721b0d3599ce6df55120017de">getRowData</a> (const <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table, const int row_id)</td></tr>
  190. <tr class="memdesc:a3657d55721b0d3599ce6df55120017de"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreive a Map of &lt;column name, column content&gt; for a specific row in the database. <br /></td></tr>
  191. <tr class="separator:a3657d55721b0d3599ce6df55120017de"><td class="memSeparator" colspan="2">&#160;</td></tr>
  192. <tr class="memitem:a2834aeb5c47bde300c898021eb9bbc48"><td class="memItemLeft" align="right" valign="top"><a id="a2834aeb5c47bde300c898021eb9bbc48"></a>
  193. <a class="el" href="class_o_p_l_1_1_pilot_entry.html">OPL::PilotEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a2834aeb5c47bde300c898021eb9bbc48">getPilotEntry</a> (int row_id)</td></tr>
  194. <tr class="memdesc:a2834aeb5c47bde300c898021eb9bbc48"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreives a <a class="el" href="class_o_p_l_1_1_pilot_entry.html" title="A Row representing a Pilot entry. See Row class for details.">PilotEntry</a> from the database. See row class for details. <br /></td></tr>
  195. <tr class="separator:a2834aeb5c47bde300c898021eb9bbc48"><td class="memSeparator" colspan="2">&#160;</td></tr>
  196. <tr class="memitem:a95340bb482ca788e748a597d013424ea"><td class="memItemLeft" align="right" valign="top"><a id="a95340bb482ca788e748a597d013424ea"></a>
  197. <a class="el" href="class_o_p_l_1_1_tail_entry.html">OPL::TailEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a95340bb482ca788e748a597d013424ea">getTailEntry</a> (int row_id)</td></tr>
  198. <tr class="memdesc:a95340bb482ca788e748a597d013424ea"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreives a <a class="el" href="class_o_p_l_1_1_tail_entry.html" title="A Row representing a Tail (Registration) entry. See Row class for details.">TailEntry</a> from the database. See row class for details. <br /></td></tr>
  199. <tr class="separator:a95340bb482ca788e748a597d013424ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
  200. <tr class="memitem:a84b40aff7668c0782ae25a8d07f60922"><td class="memItemLeft" align="right" valign="top"><a id="a84b40aff7668c0782ae25a8d07f60922"></a>
  201. <a class="el" href="class_o_p_l_1_1_aircraft_entry.html">OPL::AircraftEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a84b40aff7668c0782ae25a8d07f60922">getAircraftEntry</a> (int row_id)</td></tr>
  202. <tr class="memdesc:a84b40aff7668c0782ae25a8d07f60922"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreives a <a class="el" href="class_o_p_l_1_1_tail_entry.html" title="A Row representing a Tail (Registration) entry. See Row class for details.">TailEntry</a> from the database. See row class for details. <br /></td></tr>
  203. <tr class="separator:a84b40aff7668c0782ae25a8d07f60922"><td class="memSeparator" colspan="2">&#160;</td></tr>
  204. <tr class="memitem:a568d32e69f438bc165a2a9c1477eaaed"><td class="memItemLeft" align="right" valign="top"><a id="a568d32e69f438bc165a2a9c1477eaaed"></a>
  205. <a class="el" href="class_o_p_l_1_1_flight_entry.html">OPL::FlightEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a568d32e69f438bc165a2a9c1477eaaed">getFlightEntry</a> (int row_id)</td></tr>
  206. <tr class="memdesc:a568d32e69f438bc165a2a9c1477eaaed"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreives a flight entry from the database. See row class for details. <br /></td></tr>
  207. <tr class="separator:a568d32e69f438bc165a2a9c1477eaaed"><td class="memSeparator" colspan="2">&#160;</td></tr>
  208. <tr class="memitem:a9e7e61e354d4438dab48a39fb6de1777"><td class="memItemLeft" align="right" valign="top"><a id="a9e7e61e354d4438dab48a39fb6de1777"></a>
  209. <a class="el" href="class_o_p_l_1_1_simulator_entry.html">OPL::SimulatorEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a9e7e61e354d4438dab48a39fb6de1777">getSimEntry</a> (int row_id)</td></tr>
  210. <tr class="memdesc:a9e7e61e354d4438dab48a39fb6de1777"><td class="mdescLeft">&#160;</td><td class="mdescRight">retreives a Simulator entry from the database. See row class for details. <br /></td></tr>
  211. <tr class="separator:a9e7e61e354d4438dab48a39fb6de1777"><td class="memSeparator" colspan="2">&#160;</td></tr>
  212. <tr class="memitem:affb40bf4566d45bdf2a68203b53be4db"><td class="memItemLeft" align="right" valign="top"><a id="affb40bf4566d45bdf2a68203b53be4db"></a>
  213. <a class="el" href="class_o_p_l_1_1_currency_entry.html">OPL::CurrencyEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#affb40bf4566d45bdf2a68203b53be4db">getCurrencyEntry</a> (int row_id)</td></tr>
  214. <tr class="memdesc:affb40bf4566d45bdf2a68203b53be4db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retreives a currency entry from the database. See row class for details. <br /></td></tr>
  215. <tr class="separator:affb40bf4566d45bdf2a68203b53be4db"><td class="memSeparator" colspan="2">&#160;</td></tr>
  216. <tr class="memitem:a56ae415d548dca9c6ab3cc0fe0bc818d"><td class="memItemLeft" align="right" valign="top"><a id="a56ae415d548dca9c6ab3cc0fe0bc818d"></a>
  217. <a class="el" href="class_o_p_l_1_1_airport_entry.html">OPL::AirportEntry</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a56ae415d548dca9c6ab3cc0fe0bc818d">getAirportEntry</a> (int row_id)</td></tr>
  218. <tr class="memdesc:a56ae415d548dca9c6ab3cc0fe0bc818d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retreives an airport entry from the database. See row class for details. <br /></td></tr>
  219. <tr class="separator:a56ae415d548dca9c6ab3cc0fe0bc818d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  220. <tr class="memitem:aebf3371c149463c49e818999c427ce6a"><td class="memItemLeft" align="right" valign="top"><a id="aebf3371c149463c49e818999c427ce6a"></a>
  221. int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aebf3371c149463c49e818999c427ce6a">getLastEntry</a> (<a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table)</td></tr>
  222. <tr class="memdesc:aebf3371c149463c49e818999c427ce6a"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns the ROWID for the newest entry in the respective table. <br /></td></tr>
  223. <tr class="separator:aebf3371c149463c49e818999c427ce6a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  224. <tr class="memitem:a4eb45d764952d44a3c45f16aea2e26d7"><td class="memItemLeft" align="right" valign="top"><a id="a4eb45d764952d44a3c45f16aea2e26d7"></a>
  225. QList&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a4eb45d764952d44a3c45f16aea2e26d7">getForeignKeyConstraints</a> (int foreign_row_id, <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table)</td></tr>
  226. <tr class="memdesc:a4eb45d764952d44a3c45f16aea2e26d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">returns a list of ROWID's in the flights table for which foreign key constraints exist. <br /></td></tr>
  227. <tr class="separator:a4eb45d764952d44a3c45f16aea2e26d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  228. <tr class="memitem:a8145a21f5980cb3c55778fbe94ef52a0"><td class="memItemLeft" align="right" valign="top">QVector&lt; RowData_T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a8145a21f5980cb3c55778fbe94ef52a0">getTable</a> (<a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> table)</td></tr>
  229. <tr class="memdesc:a8145a21f5980cb3c55778fbe94ef52a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">getTable returns all contents of a given table from the database <a href="class_o_p_l_1_1_database.html#a8145a21f5980cb3c55778fbe94ef52a0">More...</a><br /></td></tr>
  230. <tr class="separator:a8145a21f5980cb3c55778fbe94ef52a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  231. <tr class="memitem:ac0db9f1a1817bb62302b17a22327bfeb"><td class="memItemLeft" align="right" valign="top"><a id="ac0db9f1a1817bb62302b17a22327bfeb"></a>
  232. const QList&lt; <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#ac0db9f1a1817bb62302b17a22327bfeb">getUserTables</a> () const</td></tr>
  233. <tr class="memdesc:ac0db9f1a1817bb62302b17a22327bfeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">getUserTables returns a list of the of the tables that contain user-created data (flights, pilots,..) <br /></td></tr>
  234. <tr class="separator:ac0db9f1a1817bb62302b17a22327bfeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
  235. <tr class="memitem:ad7cd939e58af8f1fd46f835ee34567e3"><td class="memItemLeft" align="right" valign="top"><a id="ad7cd939e58af8f1fd46f835ee34567e3"></a>
  236. const QList&lt; <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a> &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#ad7cd939e58af8f1fd46f835ee34567e3">getTemplateTables</a> () const</td></tr>
  237. <tr class="memdesc:ad7cd939e58af8f1fd46f835ee34567e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">getTemplateTables returns a list of the tables that contain template data (aiports, aircraft,..) <br /></td></tr>
  238. <tr class="separator:ad7cd939e58af8f1fd46f835ee34567e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  239. <tr class="memitem:a92c22cb18c5a23858edd38e0ed9d7117"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a92c22cb18c5a23858edd38e0ed9d7117">createSchema</a> ()</td></tr>
  240. <tr class="memdesc:a92c22cb18c5a23858edd38e0ed9d7117"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create or restore the database to its ready-to-use but empty state. <a href="class_o_p_l_1_1_database.html#a92c22cb18c5a23858edd38e0ed9d7117">More...</a><br /></td></tr>
  241. <tr class="separator:a92c22cb18c5a23858edd38e0ed9d7117"><td class="memSeparator" colspan="2">&#160;</td></tr>
  242. <tr class="memitem:a4be4811cb27c836070a6b8c09dee6a3b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a4be4811cb27c836070a6b8c09dee6a3b">importTemplateData</a> (bool use_local_ressources)</td></tr>
  243. <tr class="memdesc:a4be4811cb27c836070a6b8c09dee6a3b"><td class="mdescLeft">&#160;</td><td class="mdescRight">importTemplateData fills an empty database with the template data (Aircraft, Airports, currencies, changelog) as read from the JSON templates. <a href="class_o_p_l_1_1_database.html#a4be4811cb27c836070a6b8c09dee6a3b">More...</a><br /></td></tr>
  244. <tr class="separator:a4be4811cb27c836070a6b8c09dee6a3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  245. <tr class="memitem:a63af56a9fbd8cd0290494cc28d327824"><td class="memItemLeft" align="right" valign="top"><a id="a63af56a9fbd8cd0290494cc28d327824"></a>
  246. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a63af56a9fbd8cd0290494cc28d327824">resetUserData</a> ()</td></tr>
  247. <tr class="memdesc:a63af56a9fbd8cd0290494cc28d327824"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete all rows from the user data tables (flights, pliots, tails) <br /></td></tr>
  248. <tr class="separator:a63af56a9fbd8cd0290494cc28d327824"><td class="memSeparator" colspan="2">&#160;</td></tr>
  249. <tr class="memitem:a40cdc1cce81919c42f91e2e16a63df4a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a">createBackup</a> (const QString &amp;dest_file)</td></tr>
  250. <tr class="memdesc:a40cdc1cce81919c42f91e2e16a63df4a"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a" title="Database::createBackup copies the currently used database to an external backup location provided by ...">Database::createBackup</a> copies the currently used database to an external backup location provided by the user. <a href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a">More...</a><br /></td></tr>
  251. <tr class="separator:a40cdc1cce81919c42f91e2e16a63df4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  252. <tr class="memitem:a77003350c44e7c6e1c8c4316cc324496"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496">restoreBackup</a> (const QString &amp;backup_file)</td></tr>
  253. <tr class="memdesc:a77003350c44e7c6e1c8c4316cc324496"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496" title="Database::restoreBackup restores the database from a given backup file and replaces the currently act...">Database::restoreBackup</a> restores the database from a given backup file and replaces the currently active database. <a href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496">More...</a><br /></td></tr>
  254. <tr class="separator:a77003350c44e7c6e1c8c4316cc324496"><td class="memSeparator" colspan="2">&#160;</td></tr>
  255. </table><table class="memberdecls">
  256. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
  257. Static Public Member Functions</h2></td></tr>
  258. <tr class="memitem:a285c9a2e2436748e1b110232aba30124"><td class="memItemLeft" align="right" valign="top"><a id="a285c9a2e2436748e1b110232aba30124"></a>
  259. static <a class="el" href="class_o_p_l_1_1_database.html">Database</a> *&#160;</td><td class="memItemRight" valign="bottom"><b>instance</b> ()</td></tr>
  260. <tr class="separator:a285c9a2e2436748e1b110232aba30124"><td class="memSeparator" colspan="2">&#160;</td></tr>
  261. <tr class="memitem:a233943791f4bca3aa083f46562eb6d50"><td class="memItemLeft" align="right" valign="top">static QSqlDatabase&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#a233943791f4bca3aa083f46562eb6d50">database</a> ()</td></tr>
  262. <tr class="memdesc:a233943791f4bca3aa083f46562eb6d50"><td class="mdescLeft">&#160;</td><td class="mdescRight">Can be used to access the database connection. <a href="class_o_p_l_1_1_database.html#a233943791f4bca3aa083f46562eb6d50">More...</a><br /></td></tr>
  263. <tr class="separator:a233943791f4bca3aa083f46562eb6d50"><td class="memSeparator" colspan="2">&#160;</td></tr>
  264. </table><table class="memberdecls">
  265. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
  266. Public Attributes</h2></td></tr>
  267. <tr class="memitem:aa5b783822a603bdcfd1d8c93ba0af34b"><td class="memItemLeft" align="right" valign="top">QSqlError&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_o_p_l_1_1_database.html#aa5b783822a603bdcfd1d8c93ba0af34b">lastError</a></td></tr>
  268. <tr class="memdesc:aa5b783822a603bdcfd1d8c93ba0af34b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Holds information about the last error that ocurred during a SQL operation. If the error type is QSqlError::UnknownError, the error is related to data from the database (entry not found,...), otherwise the error is related to SQL execution. In this case error.type() provides further information. <a href="class_o_p_l_1_1_database.html#aa5b783822a603bdcfd1d8c93ba0af34b">More...</a><br /></td></tr>
  269. <tr class="separator:aa5b783822a603bdcfd1d8c93ba0af34b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  270. </table>
  271. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  272. <div class="textblock"><p>The DB class encapsulates the SQL database by providing fast access to hot database data. </p>
  273. </div><h2 class="groupheader">Member Function Documentation</h2>
  274. <a id="aa83b4d2d9cc2f9e24aaae6a25df829f2"></a>
  275. <h2 class="memtitle"><span class="permalink"><a href="#aa83b4d2d9cc2f9e24aaae6a25df829f2">&#9670;&nbsp;</a></span>commit()</h2>
  276. <div class="memitem">
  277. <div class="memproto">
  278. <table class="memname">
  279. <tr>
  280. <td class="memname">bool OPL::Database::commit </td>
  281. <td>(</td>
  282. <td class="paramtype">const QJsonArray &amp;&#160;</td>
  283. <td class="paramname"><em>json_arr</em>, </td>
  284. </tr>
  285. <tr>
  286. <td class="paramkey"></td>
  287. <td></td>
  288. <td class="paramtype">const <a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a>&#160;</td>
  289. <td class="paramname"><em>table</em>&#160;</td>
  290. </tr>
  291. <tr>
  292. <td></td>
  293. <td>)</td>
  294. <td></td><td></td>
  295. </tr>
  296. </table>
  297. </div><div class="memdoc">
  298. <p>commits data imported from JSON </p>
  299. <p>This function is used to import values to the databases which are held in JSON documents. These entries are pre-filled data used for providing completion data, such as Airport or Aircraft Type Data. </p>
  300. </div>
  301. </div>
  302. <a id="a40cdc1cce81919c42f91e2e16a63df4a"></a>
  303. <h2 class="memtitle"><span class="permalink"><a href="#a40cdc1cce81919c42f91e2e16a63df4a">&#9670;&nbsp;</a></span>createBackup()</h2>
  304. <div class="memitem">
  305. <div class="memproto">
  306. <table class="memname">
  307. <tr>
  308. <td class="memname">bool OPL::Database::createBackup </td>
  309. <td>(</td>
  310. <td class="paramtype">const QString &amp;&#160;</td>
  311. <td class="paramname"><em>dest_file</em></td><td>)</td>
  312. <td></td>
  313. </tr>
  314. </table>
  315. </div><div class="memdoc">
  316. <p><a class="el" href="class_o_p_l_1_1_database.html#a40cdc1cce81919c42f91e2e16a63df4a" title="Database::createBackup copies the currently used database to an external backup location provided by ...">Database::createBackup</a> copies the currently used database to an external backup location provided by the user. </p>
  317. <dl class="params"><dt>Parameters</dt><dd>
  318. <table class="params">
  319. <tr><td class="paramname">dest_file</td><td>This is the full path and filename of where the backup will be created, e.g. 'home/Sully/myBackups/backupFromOpl.db' </td></tr>
  320. </table>
  321. </dd>
  322. </dl>
  323. </div>
  324. </div>
  325. <a id="a92c22cb18c5a23858edd38e0ed9d7117"></a>
  326. <h2 class="memtitle"><span class="permalink"><a href="#a92c22cb18c5a23858edd38e0ed9d7117">&#9670;&nbsp;</a></span>createSchema()</h2>
  327. <div class="memitem">
  328. <div class="memproto">
  329. <table class="memname">
  330. <tr>
  331. <td class="memname">bool OPL::Database::createSchema </td>
  332. <td>(</td>
  333. <td class="paramname"></td><td>)</td>
  334. <td></td>
  335. </tr>
  336. </table>
  337. </div><div class="memdoc">
  338. <p>Create or restore the database to its ready-to-use but empty state. </p>
  339. <p>The SQL code for the database creation is stored in a .sql file which is available as a ressource. This file gets read, and the querys executed. If errors occur, returns false. </p>
  340. </div>
  341. </div>
  342. <a id="abf45cf7ba5d25bb5d8f8aac1105bb728"></a>
  343. <h2 class="memtitle"><span class="permalink"><a href="#abf45cf7ba5d25bb5d8f8aac1105bb728">&#9670;&nbsp;</a></span>customQuery()</h2>
  344. <div class="memitem">
  345. <div class="memproto">
  346. <table class="memname">
  347. <tr>
  348. <td class="memname">QVector&lt; QVariant &gt; OPL::Database::customQuery </td>
  349. <td>(</td>
  350. <td class="paramtype">QString&#160;</td>
  351. <td class="paramname"><em>statement</em>, </td>
  352. </tr>
  353. <tr>
  354. <td class="paramkey"></td>
  355. <td></td>
  356. <td class="paramtype">int&#160;</td>
  357. <td class="paramname"><em>return_values</em>&#160;</td>
  358. </tr>
  359. <tr>
  360. <td></td>
  361. <td>)</td>
  362. <td></td><td></td>
  363. </tr>
  364. </table>
  365. </div><div class="memdoc">
  366. <p>Can be used to send a complex query to the database. </p>
  367. <dl class="params"><dt>Parameters</dt><dd>
  368. <table class="params">
  369. <tr><td class="paramname">query</td><td>- the full sql query statement </td></tr>
  370. <tr><td class="paramname">returnValues</td><td>- the number of return values </td></tr>
  371. </table>
  372. </dd>
  373. </dl>
  374. </div>
  375. </div>
  376. <a id="a233943791f4bca3aa083f46562eb6d50"></a>
  377. <h2 class="memtitle"><span class="permalink"><a href="#a233943791f4bca3aa083f46562eb6d50">&#9670;&nbsp;</a></span>database()</h2>
  378. <div class="memitem">
  379. <div class="memproto">
  380. <table class="mlabels">
  381. <tr>
  382. <td class="mlabels-left">
  383. <table class="memname">
  384. <tr>
  385. <td class="memname">QSqlDatabase OPL::Database::database </td>
  386. <td>(</td>
  387. <td class="paramname"></td><td>)</td>
  388. <td></td>
  389. </tr>
  390. </table>
  391. </td>
  392. <td class="mlabels-right">
  393. <span class="mlabels"><span class="mlabel">static</span></span> </td>
  394. </tr>
  395. </table>
  396. </div><div class="memdoc">
  397. <p>Can be used to access the database connection. </p>
  398. <dl class="section return"><dt>Returns</dt><dd>The QSqlDatabase object pertaining to the connection. </dd></dl>
  399. </div>
  400. </div>
  401. <a id="a8145a21f5980cb3c55778fbe94ef52a0"></a>
  402. <h2 class="memtitle"><span class="permalink"><a href="#a8145a21f5980cb3c55778fbe94ef52a0">&#9670;&nbsp;</a></span>getTable()</h2>
  403. <div class="memitem">
  404. <div class="memproto">
  405. <table class="memname">
  406. <tr>
  407. <td class="memname">QVector&lt; RowData_T &gt; OPL::Database::getTable </td>
  408. <td>(</td>
  409. <td class="paramtype"><a class="el" href="namespace_o_p_l.html#ada86eb02cea54d91c8c11c9112ec1cf7">OPL::DbTable</a>&#160;</td>
  410. <td class="paramname"><em>table</em></td><td>)</td>
  411. <td></td>
  412. </tr>
  413. </table>
  414. </div><div class="memdoc">
  415. <p>getTable returns all contents of a given table from the database </p>
  416. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  417. </div>
  418. </div>
  419. <a id="a4be4811cb27c836070a6b8c09dee6a3b"></a>
  420. <h2 class="memtitle"><span class="permalink"><a href="#a4be4811cb27c836070a6b8c09dee6a3b">&#9670;&nbsp;</a></span>importTemplateData()</h2>
  421. <div class="memitem">
  422. <div class="memproto">
  423. <table class="memname">
  424. <tr>
  425. <td class="memname">bool OPL::Database::importTemplateData </td>
  426. <td>(</td>
  427. <td class="paramtype">bool&#160;</td>
  428. <td class="paramname"><em>use_local_ressources</em></td><td>)</td>
  429. <td></td>
  430. </tr>
  431. </table>
  432. </div><div class="memdoc">
  433. <p>importTemplateData fills an empty database with the template data (Aircraft, Airports, currencies, changelog) as read from the JSON templates. </p>
  434. <dl class="params"><dt>Parameters</dt><dd>
  435. <table class="params">
  436. <tr><td class="paramname">use_local_ressources</td><td>determines whether the included ressource files or a previously downloaded file should be used. </td></tr>
  437. </table>
  438. </dd>
  439. </dl>
  440. <dl class="section return"><dt>Returns</dt><dd></dd></dl>
  441. </div>
  442. </div>
  443. <a id="a77003350c44e7c6e1c8c4316cc324496"></a>
  444. <h2 class="memtitle"><span class="permalink"><a href="#a77003350c44e7c6e1c8c4316cc324496">&#9670;&nbsp;</a></span>restoreBackup()</h2>
  445. <div class="memitem">
  446. <div class="memproto">
  447. <table class="memname">
  448. <tr>
  449. <td class="memname">bool OPL::Database::restoreBackup </td>
  450. <td>(</td>
  451. <td class="paramtype">const QString &amp;&#160;</td>
  452. <td class="paramname"><em>backup_file</em></td><td>)</td>
  453. <td></td>
  454. </tr>
  455. </table>
  456. </div><div class="memdoc">
  457. <p><a class="el" href="class_o_p_l_1_1_database.html#a77003350c44e7c6e1c8c4316cc324496" title="Database::restoreBackup restores the database from a given backup file and replaces the currently act...">Database::restoreBackup</a> restores the database from a given backup file and replaces the currently active database. </p>
  458. <dl class="params"><dt>Parameters</dt><dd>
  459. <table class="params">
  460. <tr><td class="paramname">backup_file</td><td>This is the full path and filename of the backup, e.g. 'home/Sully/myBackups/backupFromOpl.db' </td></tr>
  461. </table>
  462. </dd>
  463. </dl>
  464. </div>
  465. </div>
  466. <a id="a0b20bec0f8bef0277325492a1dee33ef"></a>
  467. <h2 class="memtitle"><span class="permalink"><a href="#a0b20bec0f8bef0277325492a1dee33ef">&#9670;&nbsp;</a></span>sqliteVersion()</h2>
  468. <div class="memitem">
  469. <div class="memproto">
  470. <table class="memname">
  471. <tr>
  472. <td class="memname">const QString OPL::Database::sqliteVersion </td>
  473. <td>(</td>
  474. <td class="paramname"></td><td>)</td>
  475. <td> const</td>
  476. </tr>
  477. </table>
  478. </div><div class="memdoc">
  479. <p><a class="el" href="class_o_p_l_1_1_database.html#a0b20bec0f8bef0277325492a1dee33ef" title="Database::sqliteVersion returns the database sqlite version. See also dbRevision()">Database::sqliteVersion</a> returns the database sqlite version. See also dbRevision() </p>
  480. <dl class="section return"><dt>Returns</dt><dd>sqlite version string </dd></dl>
  481. </div>
  482. </div>
  483. <h2 class="groupheader">Member Data Documentation</h2>
  484. <a id="aa5b783822a603bdcfd1d8c93ba0af34b"></a>
  485. <h2 class="memtitle"><span class="permalink"><a href="#aa5b783822a603bdcfd1d8c93ba0af34b">&#9670;&nbsp;</a></span>lastError</h2>
  486. <div class="memitem">
  487. <div class="memproto">
  488. <table class="memname">
  489. <tr>
  490. <td class="memname">QSqlError OPL::Database::lastError</td>
  491. </tr>
  492. </table>
  493. </div><div class="memdoc">
  494. <p>Holds information about the last error that ocurred during a SQL operation. If the error type is QSqlError::UnknownError, the error is related to data from the database (entry not found,...), otherwise the error is related to SQL execution. In this case error.type() provides further information. </p>
  495. <p>If the error type is QSqlError::NoError, the last executed database query was successful. </p>
  496. </div>
  497. </div>
  498. <hr/>The documentation for this class was generated from the following files:<ul>
  499. <li>src/database/<a class="el" href="database_8h_source.html">database.h</a></li>
  500. <li>src/database/database.cpp</li>
  501. </ul>
  502. </div><!-- contents -->
  503. </div><!-- doc-content -->
  504. <!-- start footer part -->
  505. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  506. <ul>
  507. <li class="navelem"><a class="el" href="namespace_o_p_l.html">OPL</a></li><li class="navelem"><a class="el" href="class_o_p_l_1_1_database.html">Database</a></li>
  508. <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  509. </ul>
  510. </div>
  511. </body>
  512. </html>