├── .gitignore ├── Delphinus.Info.json ├── Delphinus.Install.json ├── LICENSE.txt ├── Quick.DAO.Database.pas ├── Quick.DAO.Engine.ADO.pas ├── Quick.DAO.Engine.FireDAC.pas ├── Quick.DAO.Engine.SQLite3.pas ├── Quick.DAO.Factory.QueryGenerator.pas ├── Quick.DAO.Query.pas ├── Quick.DAO.QueryGenerator.MSAccess.pas ├── Quick.DAO.QueryGenerator.MSSQL.pas ├── Quick.DAO.QueryGenerator.MySQL.pas ├── Quick.DAO.QueryGenerator.SQLite.pas ├── Quick.DAO.pas ├── QuickDAO.inc ├── QuickDAO.png ├── README.md └── samples ├── delphi ├── MSAccess │ ├── DAOMSAccess.dpr │ ├── DAOMSAccess.dproj │ └── DAOMSAccess.res ├── MSSQL │ ├── DAOMSSQL.dpr │ ├── DAOMSSQL.dproj │ └── DAOMSSQL.res └── SQLite │ ├── DAOSQLite.dpr │ ├── DAOSQLite.dproj │ └── DAOSQLite.res ├── firemonkey ├── DAOSQLite.deployproj ├── DAOSQLite.dpr ├── DAOSQLite.dproj ├── DAOSQLite.res ├── Main.fmx └── Main.pas └── fpc └── SQLite ├── DAOSQLite.lpi ├── DAOSQLite.lps ├── DAOSQLite.pas └── backup └── DAOSQLite.lps /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.accdb 3 | 4 | samples/delphi/SQLite/Win32/Debug/ 5 | 6 | samples/firemonkey/Android/Debug/ 7 | 8 | samples/firemonkey/OSX32/Debug/ 9 | 10 | samples/firemonkey/Win64/Debug/ 11 | 12 | samples/fpc/SQLite/lib/i386-win32/ 13 | 14 | samples/firemonkey/Android/Release/DAOSQLite/library/lib/armeabi-v7a/ 15 | 16 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-hdpi/ 17 | 18 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-large/ 19 | 20 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-ldpi/ 21 | 22 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-normal/ 23 | 24 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-mdpi/ 25 | 26 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-small/ 27 | 28 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-xxhdpi/ 29 | 30 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable/ 31 | 32 | *.xml 33 | 34 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-xlarge/ 35 | 36 | samples/firemonkey/Android/Release/DAOSQLite/res/drawable-xhdpi/ 37 | 38 | samples/firemonkey/Android/Release/DAOSQLite/classes/ 39 | 40 | samples/firemonkey/Android/Release/ 41 | -------------------------------------------------------------------------------- /Delphinus.Info.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "{955D59BD-F79A-4BDE-98A6-6955F82C24BC}", 3 | "name": "", 4 | "picture": "QuickDAO.png", 5 | "license_type": "Apache-2.0", 6 | "license_file": "LICENSE.txt", 7 | "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64", 8 | "package_compiler_min": 22, 9 | "package_compiler_max": 34, 10 | "compiler_min": 22, 11 | "compiler_max": 34, 12 | "first_version": "", 13 | "report_url": "", 14 | "dependencies": 15 | [ 16 | { 17 | "id": "{039708CE-1DC1-4FC5-A58E-A77B3177A9C8}", 18 | "version_min": "1.0" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /Delphinus.Install.json: -------------------------------------------------------------------------------- 1 | { 2 | "search_pathes": 3 | [ 4 | { 5 | "pathes": ".", 6 | "platforms": "Win32;Win64;OSX32;Android;IOSDevice32;IOSDevice64;Linux64" 7 | } 8 | ], 9 | "browsing_pathes": 10 | [ 11 | { 12 | "pathes": ".", 13 | "platforms": "Win32;Win64;Linux64" 14 | } 15 | ], 16 | 17 | "source_folders": 18 | [ 19 | { 20 | "folder": ".", 21 | "recursive": true, 22 | "filter": "*;*.*" 23 | } 24 | ] 25 | 26 | } -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /Quick.DAO.Database.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Database.pas -------------------------------------------------------------------------------- /Quick.DAO.Engine.ADO.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Engine.ADO.pas -------------------------------------------------------------------------------- /Quick.DAO.Engine.FireDAC.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Engine.FireDAC.pas -------------------------------------------------------------------------------- /Quick.DAO.Engine.SQLite3.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Engine.SQLite3.pas -------------------------------------------------------------------------------- /Quick.DAO.Factory.QueryGenerator.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Factory.QueryGenerator.pas -------------------------------------------------------------------------------- /Quick.DAO.Query.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.Query.pas -------------------------------------------------------------------------------- /Quick.DAO.QueryGenerator.MSAccess.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.QueryGenerator.MSAccess.pas -------------------------------------------------------------------------------- /Quick.DAO.QueryGenerator.MSSQL.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.QueryGenerator.MSSQL.pas -------------------------------------------------------------------------------- /Quick.DAO.QueryGenerator.MySQL.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.QueryGenerator.MySQL.pas -------------------------------------------------------------------------------- /Quick.DAO.QueryGenerator.SQLite.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.QueryGenerator.SQLite.pas -------------------------------------------------------------------------------- /Quick.DAO.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/Quick.DAO.pas -------------------------------------------------------------------------------- /QuickDAO.inc: -------------------------------------------------------------------------------- 1 | { 2 | This file is part of QuickDAO: https://github.com/exilon/QuickDAO 3 | 4 | QuickLibs. Copyright (C) 2020 Kike Pérez 5 | Exilon - https://www.exilon.es 6 | 7 | *************************************************************************** 8 | 9 | Licensed under the Apache License, Version 2.0 (the "License"); 10 | you may not use this file except in compliance with the License. 11 | You may obtain a copy of the License at 12 | 13 | http://www.apache.org/licenses/LICENSE-2.0 14 | 15 | Unless required by applicable law or agreed to in writing, software 16 | distributed under the License is distributed on an "AS IS" BASIS, 17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | See the License for the specific language governing permissions and 19 | limitations under the License. 20 | 21 | *************************************************************************** 22 | } 23 | 24 | {$ifdef FPC} 25 | {$MODE DELPHI} 26 | 27 | {$INLINE ON} 28 | {$define HASINLINE} 29 | 30 | {$ifdef LINUX} 31 | {$define FPCLINUX} 32 | {$endif} 33 | 34 | {$ifdef ANDROID} 35 | {$define LINUX} 36 | {$endif} 37 | 38 | {$ifdef VER2_7} 39 | {$define ISFPC27} 40 | {$endif} 41 | 42 | {$ifdef VER3_0} 43 | {$define ISFPC27} 44 | {$define ISFPC30} 45 | {$endif} 46 | 47 | {$ifdef VER3_1} 48 | {$define ISFPC27} 49 | {$define ISFPC30} 50 | {$endif} 51 | 52 | {$ifdef FPC_REQUIRES_PROPER_ALIGNMENT} 53 | {$define FPC_ENUMHASINNER} 54 | {$endif} 55 | 56 | {$ifdef FPC_HAS_MANAGEMENT_OPERATORS} 57 | {$define ISDELPHI2006ANDUP} 58 | {$endif FPC_HAS_MANAGEMENT_OPERATORS} 59 | 60 | {$else FPC} 61 | 62 | {$ifdef CONDITIONALEXPRESSIONS} //Delphi 6 or newer 63 | {$define HASINTERFACERTTI} //interface RTTI (not FPC) 64 | {$ifndef LINUX} 65 | {$ifdef VER140} 66 | {$define DELPHI6_UP} //Delphi 6 or newer 67 | {$else} 68 | {$define DELPHI7_UP} //Delphi 7 or newer 69 | {$endif} 70 | {$endif LINUX} 71 | {$if CompilerVersion >= 17} 72 | {$define DELPHI2005_UP} //Delphi 2005 or newer 73 | {$ifend} 74 | {$if CompilerVersion >= 18} 75 | {$define DELPHI2006_UP} //Delphi 2006 or newer 76 | {$define HASINLINE} 77 | {$ifend} 78 | {$if CompilerVersion > 18} 79 | {$define DELPHI2007_UP} //Delphi 2007 or newer 80 | {$ifend} 81 | {$if CompilerVersion = 20} 82 | {$define DELPHI2009_UP} //Delphi 2009 83 | {$ifend} 84 | {$if CompilerVersion >= 21.0} //Delphi 2010 85 | {$define DELPHI2010_UP} 86 | {$define FPC_OR_UNICODE} 87 | {$ifend} 88 | {$if CompilerVersion >= 22.0} //Delphi XE 89 | {$define DELPHIXE_UP} 90 | {$ifend} 91 | {$if CompilerVersion >= 23.0} //Delphi XE2 92 | {$define DELPHIXE2_UP} 93 | {$ifend} 94 | {$if CompilerVersion >= 24.0} //Delphi XE3 95 | {$define DELPHIXE3_UP} 96 | {$ifend} 97 | {$if CompilerVersion >= 25.0} //Delphi XE4 98 | {$define DELPHIXE4_UP} 99 | {$ifend} 100 | {$if CompilerVersion >= 26.0} //Delphi XE5 101 | {$define DELPHIXE5_UP} 102 | {$ifend} 103 | {$if CompilerVersion >= 27.0} //Delphi XE6 104 | {$define DELPHIXE6_UP} 105 | {$ifend} 106 | {$if CompilerVersion >= 28.0} //Delphi XE7 107 | {$define DELPHIXE7_UP} 108 | {$ifend} 109 | {$if CompilerVersion >= 29.0} //Delphi XE8 110 | {$define DELPHIXE8_UP} 111 | {$ifend} 112 | {$if CompilerVersion >= 30.0} //Delphi XE10 Seattle 113 | {$define DELPHIRX10_UP} 114 | {$define DELPHISEATTLE_UP} 115 | {$ifend} 116 | {$if CompilerVersion >= 31.0} //Delphi RX10.1 Berlin 117 | {$define DELPHIRX101_UP} 118 | {$define DELPHIBERLIN_UP} 119 | {$ifend} 120 | {$if CompilerVersion >= 32.0} //Delphi RX10.2 Tokyo 121 | {$define DELPHIRX102_UP} 122 | {$define DELPHITOKYO_UP} 123 | {$ifdef LINUX} 124 | {$define DELPHILINUX} 125 | {$ifend} 126 | {$ifend} 127 | {$if CompilerVersion >= 33.0} //Delphi RX10.3 Rio 128 | {$define DELPHIRX103_UP} 129 | {$define DELPHIRIO_UP} 130 | {$ifend} 131 | {$if CompilerVersion >= 33.0} //Delphi RX10.4 Sydney 132 | {$define DELPHIRX104_UP} 133 | {$define DELPHISYDNEY_UP} 134 | {$if defined(ANDROID) OR defined(LINUX) OR defined(IOS)} 135 | {$define NEXTGEN} //compatibility with older delphis 136 | {$endif} 137 | {$ifend} 138 | {$else} 139 | //Delphi 5 or older 140 | {$define DELPHI6OROLDER} 141 | {$define DELPHI5OROLDER} 142 | {$define DELPHI5ORFPC} 143 | {$define MSWINDOWS} 144 | {$endif} 145 | 146 | {$endif FPC} 147 | 148 | {$ifdef VER150} 149 | {$WARN SYMBOL_DEPRECATED OFF} 150 | {$WARN UNSAFE_TYPE OFF} 151 | {$WARN UNSAFE_CODE OFF} 152 | {$WARN UNSAFE_CAST OFF} 153 | {$ENDIF} 154 | 155 | {$ifdef CONDITIONALEXPRESSIONS} //Delphi 6 or newer 156 | {.$WARN SYMBOL_PLATFORM OFF} 157 | {.$WARN UNIT_PLATFORM OFF} 158 | {$endif} 159 | 160 | {.$define SHOW_ENVIRONMENTPATH_ERRORS} 161 | 162 | 163 | -------------------------------------------------------------------------------- /QuickDAO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/QuickDAO.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **QuickDAO** 2 | -------- 3 | 4 | Data Access Object library for delphi/Firemonkey(Windows, Linux, Android, OSX & IOS) and Freepascal(Alpha: Windows/Linux) using objects & LinQ to simplify access to databases. 5 | 6 | **Features:** 7 | 8 | * **DAO**: Abstracts database layer, working with objects directly. 9 | * **MultiEngine**: Supports different database engines/components like FireDAC, ADODB and SQLite3 (by Plasenkov). 10 | * **MultiLanguage**: Automatic query translation to different database languages (SQLite, MSSSQL, MySQL, MSAccess,...) 11 | * **Querying**: Use LinQ to simplify database interaction. 12 | 13 | **Main units description:** 14 | - **Quick.DAO:** Main library core. 15 | - **Quick.DAO.Database:** Database management core. 16 | - **Quick.DAO.Query:** Query and lambda LinQ operators core. 17 | - **Quick.DAO.Engine.FireDAC:** Embarcadero FireDAC engine (supports many databases: MSSQL, MySQL, SQLite, etc...). 18 | - **Quick.DAO.Engine.ADO:** Microsoft ADO engine (Supports many databases: MSSQL, MSAccess and ODBC connectors) 19 | - **Quick.DAO.Engine.SQLite:** SQLite engine (SQLite library implementation by Plasenkov (https://github.com/plashenkov/SQLite3-Delphi-FPC) 20 | - **Quick.DAO.Query.Generator:** Query translation language core. 21 | - **Quick.DAO.QueryGenerator.MSSSQL:** Query functions for MSSQL. 22 | - **Quick.DAO.QueryGenerator.MySQL:** Query functions for MySQL. 23 | - **Quick.DAO.QueryGenerator.SQLite3:** Query functions for SQLite. 24 | 25 | **Updates:** 26 | 27 | * NEW: Optional Pluralize Tablenames convention. 28 | * NEW: Freepascal alpha version (partially supported). 29 | * NEW: First Delphi/Firemonkey beta version. 30 | 31 | **Documentation:** 32 | ---------- 33 | With QuickDAO you can work with databases the similar way you work with objects, abstracting database layer. With LinQ lambda operators integrated you can make powerful queries easily. 34 | 35 | **DAORecord:** 36 | ---- 37 | ---- 38 | DAORecord is a data model class. Works as a mapping to a database table record. DAORecord class name determines corresponding table name (TUser -> User) and every published property will correspon to a field in database. 39 | DAORecord can connect to existing tables (database-first) or will create it if not exists yet (code-first). 40 | DAORecord class name and properties can be mapped to different table and property names. 41 | You ever must define a primary key for every DAORecord. 42 | 43 | ```delphi 44 | TUser = class(TDAORecord) 45 | private 46 | fName : string; 47 | fAge : Integer; 48 | published 49 | property Name : string read fName write fName; 50 | property Age : Integer read fAge write fAge; 51 | end; 52 | ``` 53 | 54 | **Field types:** 55 | Quick DAO automatically converts class types to database types and viceversa. By default, string properties will be nvarchar(MAX) and Double don't have decimal limit, if you want to limit lenght you can use index property or custom attributes. 56 | Arrays, List and ObjectList properties stores as JSON in database. 57 | 58 | ```delphi 59 | //limit Name to 30 chars in database 60 | property Name : string index 30 read fName write fName; 61 | //...or 62 | [TFieldVARCHAR(50)] 63 | property Name : string read fName write fName; 64 | 65 | //limit Money to 2 decimals in database 66 | property Money : Double index 2 read fMoney write fMoney; 67 | //...or 68 | [TFieldDECIMAL(10,2)] 69 | property Money : Double read fMoney write fMoney; 70 | ``` 71 | Auto numeric fields must be indicated as TAutoID type to work correctly. 72 | ```delphi 73 | property IdUser : TAutoID read fIdUser write fIdUser; 74 | ``` 75 | 76 | **Field mapping:** 77 | Field mapping allows connect DAORecord properties to a different named field of your database. 78 | The only condition is both should be same type. 79 | ```delphi 80 | //Maps your "Name" property with database field "UserName" 81 | [TMapField('UserName')] 82 | property Name : string index 30 read fName write fName; 83 | ``` 84 | **DAODatabase**: 85 | ---- 86 | ---- 87 | DAODatabase is responsible of iterate with your database. Connect, create missing tables and indexes and querying. You can use code-first or database-first patterns. If you have an existing database and tables previously created, you need to create a DAORecord class with same name properties as your database have (or mapping to correspondent table field names). All properties without correspondent field into database will be created on connect to it. 88 | Database engine must be selected on creation. 89 | ```delphi 90 | DAODatabase := TDAODataBaseFireDAC.Create; 91 | DAODatabase.Connection.Provider := TDBProvider.daoSQLite; 92 | DAODatabase.Connection.Database := '.\test.db3'; 93 | ``` 94 | 95 | **Database engine selection:** 96 | - **FireDAC:** (Recommended) Is embarcadero database components to access databases. It's powerfull and supports many database servers. Add Quick.DAO.Engine.FireDAC to your uses clause. Delphi/Firemonkey Windows compatible. 97 | ```delphi 98 | DAODatabase := TDAODataBaseFireDAC.Create; 99 | ``` 100 | 101 | - **ADO:** Database components to access databases. Supports many database servers and ODBC connectors. Add Quick.DAO.Engine.ADO to your uses clause. Delphi compatible. 102 | ```delphi 103 | DAODatabase := TDAODataBaseADO.Create; 104 | ``` 105 | 106 | - **SQLite3:** Implementation of SQLite3 by Plasenkov (https://github.com/plashenkov/SQLite3-Delphi-FPC). Supports only SQLite3 databases. Add Quick.DAO.Engine.SQLite3 to your uses clause. Delphi/Firemonkey compatible. 107 | ```delphi 108 | DAODatabase := TDAODataBaseSQLite3.Create; 109 | ``` 110 | 111 | **Database connection settings:** 112 | - **MSSQL:** 113 | ```delphi 114 | DAODatabase := TDAODataBaseADO.Create; 115 | DAODatabase.Connection.Provider := TDBProvider.daoMSSQL; 116 | DAODatabase.Connection.Server := 'MSSQLhostname'; 117 | DAODatabase.Connection.Database := 'MyTable'; 118 | DAODatabase.Connection.UserName := 'MyUser'; 119 | DAODatabase.Conneciton.Password := 'MyPassword'; 120 | ``` 121 | - **MYSQL:** 122 | ```delphi 123 | DAODatabase := TDAODataBaseFireDAC.Create; 124 | DAODatabase.Connection.Provider := TDBProvider.daoMySQL; 125 | DAODatabase.Connection.Server := 'MySQLhostname'; 126 | DAODatabase.Connection.Database := 'MyTable'; 127 | DAODatabase.Connection.UserName := 'MyUser'; 128 | DAODatabase.Conneciton.Password := 'MyPassword'; 129 | ``` 130 | - **MSAccess:** 131 | ```delphi 132 | DAODatabase := TDAODataBaseADO.Create; 133 | DAODatabase.Connection.Provider := TDBProvider.daoMSAccess; 134 | DAODatabase.Connection.Database := '.\test.accdb'; 135 | ``` 136 | - **SQLite:** 137 | ```delphi 138 | DAODatabase := TDAODataBaseFireDAC.Create; 139 | DAODatabase.Connection.Provider := TDBProvider.daoSQLite; 140 | DAODatabase.Connection.Database := '.\test.db3'; 141 | ``` 142 | 143 | **Defining Models**: 144 | 145 | Models are all DAORecords defined (corresponding to database tables). You need to indicate wich models use your database and primary key. 146 | DAORecord class name can be mapped to a different table name. 147 | PluralizingTableNameConvention option allows pluralize your tables. 148 | ```delphi 149 | //Add model TUser with IdUser as primary key field 150 | DAODatabase.Models.Add(TUser,'IdUser'); 151 | //Add model TUser with Id as primary key field, mapped to a table named "AppUsers" 152 | DAODatabase.Models.Add(TUser,'Id','AppUsers');ñ 153 | ``` 154 | 155 | **Creating Indexes:** 156 | 157 | Indexes added to DAODatabase will be recreated on real database. You can indicate one or more fields to index. 158 | ```delphi 159 | //Add an index to field "Name" on table "User" in ascending order 160 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 161 | ``` 162 | 163 | **Connect to your database:** 164 | When Models and Indexes has been defined, you can connect to database. Missing tables, fields and indexes will be recreated. Deleted properties won't be replicated. 165 | ```delphi 166 | if DAODatabase.Connect then cout('Connected to database',etSuccess) 167 | else cout('Can''t connect to database',etError); 168 | ``` 169 | 170 | **DAOQuery:** 171 | ---- 172 | ---- 173 | DAOQuery retrieves/stores data from/to database, abstracting database layer. 174 | 175 | **Basic queries:** Records can be added, modified or deleted using DAORecord as parameter. These methods use DAORecord primary key to know which record must be processed. 176 | 177 | - **Add:** Adds new record to a table database. 178 | ```delphi 179 | DAODatabase.Add(User); 180 | ``` 181 | 182 | - **Update:** Updates an existing table database record. 183 | ```delphi 184 | DAODatabase.Update(User); 185 | ``` 186 | 187 | - **Delete:** Deletes an existing table database record. 188 | ```delphi 189 | DAODataBase.Delete(User); 190 | ``` 191 | 192 | **LinQ queries:** 193 | LinQ queries offers a simplified way to work with database records. Queries use lambda operators to concatenate commands in same object. 194 | 195 | - **From:** Indicate on which Model(table) query will be executed. 196 | 197 | - **Where(Expression)**: Applies a conditional filter to current query. 198 | ```delphi 199 | DAODatabase.From.Where('Age =',[30]).SelectFirst; 200 | DAODatabase.From.Where('Age = ? OR Name = ?',[30,'Peter']).Select('Name,Age'); 201 | DAODatabase.From.Where('(Age > ? AND Age < ?) AND (Name LIKE ?)',[30,35,'%BILLY%]).Select; 202 | ``` 203 | - **Count:** Returns number of records matching where clause. If no where clause specified, returns total records in database table. 204 | ```delphi 205 | DAODatabase.From.Count 206 | DAODatabase.From.Where('Age > ?',[30]).Count 207 | ``` 208 | - **Select:** Returns all matching records. 209 | - **Select(FieldNamesList):** Returns all matching records, but only indicated field names will be filled in resulting DAORecords (more lightweight database query if not all fields are needed). FieldNamesList parameter needs a comma separated list of property names. 210 | - **SelectFirst:** Returns first matching record. 211 | - **SelectLast:** Returns last matching record. 212 | - **SelectTop(limit):** Returns first x matching records. 213 | ```delphi 214 | iresult := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).SelectTop(10); 215 | User := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).SelectFirst; 216 | ``` 217 | Queries could return one or more records. On multiple results an iterator will be returned. 218 | ```delphi 219 | iresult := DAODatabase.From.Where('SurName = ?',['Perterson']).Select; 220 | for User in iresult do 221 | begin 222 | cout('Name: %d SurName: %s',[User.Name,User.SurName],etSuccess); 223 | User.Free; 224 | end; 225 | ``` 226 | - **OrderBy:** Defines ordenation field names in ascending order. 227 | ```delphi 228 | DAODatabase.From.Where('SurName = ?',['Perterson']).OrderBy('SurName,Name').Select; 229 | ``` 230 | 231 | - **OrderByDescending:** Defines ordenation field names in descending order. 232 | ```delphi 233 | DAODatabase.From.Where('SurName = ?',['Perterson']).OrderByDescending('SurName,Name').Select; 234 | ``` 235 | 236 | - **Update(FieldNames,FieldValuesArray):** Updates table fields matching where clause with new values provided. 237 | ```delphi 238 | DAODatabase.From.Where('Name = ?',['Joe']).Update('Working',[True]); 239 | DAODatabase.From.Where('Age > ?',[30]).Update('ModifiedDate,ContractId',[Now(),12]); 240 | ``` 241 | 242 | - **Delete:** Removes all matching records from database table. 243 | ```delphi 244 | DAODatabase.From.Where('ContractId = ?',[12]).Delete; 245 | ``` 246 | 247 | >Do you want to learn delphi or improve your skills? [learndelphi.org](https://learndelphi.org) -------------------------------------------------------------------------------- /samples/delphi/MSAccess/DAOMSAccess.dpr: -------------------------------------------------------------------------------- 1 | program DAOMSAccess; 2 | 3 | {$APPTYPE CONSOLE} 4 | 5 | {$R *.res} 6 | 7 | uses 8 | System.SysUtils, 9 | Quick.Commons, 10 | Quick.Console, 11 | Quick.Chrono, 12 | Quick.DAO, 13 | Quick.DAO.Engine.ADO; 14 | 15 | type 16 | TGenre = (gMale, gFemale); 17 | 18 | TConnection = class 19 | private 20 | fIdConnection : Integer; 21 | fConnectionDate : TDateTime; 22 | published 23 | property IdConnection : Integer read fIdConnection write fIdConnection; 24 | property ConnectionDate : TDateTime read fConnectionDate write fConnectionDate; 25 | end; 26 | 27 | TConnections = array of TConnection; 28 | 29 | TGroups = array of Int64; 30 | 31 | TLocation = record 32 | Street : string; 33 | Number : Integer; 34 | City : string; 35 | end; 36 | 37 | TUser = class(TDAORecord) 38 | private 39 | fIdUser : TAutoID; 40 | fName : string; 41 | fSurname : string; 42 | fAge : Integer; 43 | fActive : Boolean; 44 | fGenre : TGenre; 45 | fMoney : Double; 46 | fLastInfo : TDateTime; 47 | fGroups : TGroups; 48 | fLocation : TLocation; 49 | //fConnections : TConnections; 50 | published 51 | property IdUser : TAutoID read fIdUser write fIdUser; 52 | //[TFieldVARCHAR(50)] 53 | property Name : string index 50 read fName write fName; 54 | [TFieldVARCHAR(255)] 55 | property Surname : string read fSurname write fSurname; 56 | //[TMapField('UserAge')] 57 | property Age : Integer read fAge write fAge; 58 | property Active : Boolean read fActive write fActive; 59 | property Genre : TGenre read fGenre write fGenre; 60 | //[TFieldDECIMAL(10,2)] 61 | property Money : Double index 2 read fMoney write fMoney; 62 | property LastInfo : TDateTime read fLastInfo write fLastInfo; 63 | property Groups : TGroups read fGroups write fGroups; 64 | property Location : TLocation read fLocation write fLocation; 65 | //property Connections : TConnections read fConnections write fConnections; 66 | end; 67 | 68 | const 69 | UserNames : array of string = ['Cliff','Alan','Anna','Phil','John','Michel','Jennifer','Peter','Brandon','Joe','Steve','Lorraine','Bill','Tom']; 70 | UserSurnames : array of string = ['Gordon','Summer','Huan','Paterson','Johnson','Michelson','Smith','Peterson','Miller','McCarney','Roller','Gonzalez','Thomson','Muller']; 71 | 72 | var 73 | DAODatabase : TDAODataBaseADO; 74 | User : TUser; 75 | iresult : IDAOResult; 76 | NumUsers : Integer; 77 | i : Integer; 78 | crono : TChronometer; 79 | location : TLocation; 80 | 81 | begin 82 | try 83 | ReportMemoryLeaksOnShutdown := True; 84 | crono := TChronometer.Create(False); 85 | 86 | DAODatabase := TDAODataBaseADO.Create; 87 | DAODatabase.Connection.Provider := db_MSAccess2007; 88 | DAODatabase.Connection.Database := '.\test.accdb'; 89 | DAODatabase.Models.Add(TUser,'IdUser'); 90 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 91 | if DAODatabase.Connect then cout('Connected to database',etSuccess) 92 | else cout('Can''t connect to database',etError); 93 | 94 | NumUsers := 100; 95 | 96 | cout('Adding %d users to db...',[NumUsers],etInfo); 97 | crono.Start; 98 | //create random records 99 | User := TUser.Create; 100 | try 101 | for i := 1 to NumUsers do 102 | begin 103 | //User.IdUser := Random(999999999999999); 104 | User.Name := UserNames[Random(High(UserNames))]; 105 | User.Surname := UserSurnames[Random(High(UserSurnames))] + ' ' + UserSurnames[Random(High(UserSurnames))];; 106 | User.Age := Random(30)+18; 107 | User.Genre := TGenre(Random(1)); 108 | User.LastInfo := Now(); 109 | User.Money := Random(50000); 110 | User.Active := True; 111 | User.Groups := [1,2,3,4,5,6,7]; 112 | location.Street := 'Main St'; 113 | location.Number := 1; 114 | location.City := 'London'; 115 | User.Location := location; 116 | DAODatabase.Add(User); 117 | end; 118 | finally 119 | User.Free; 120 | end; 121 | crono.Stop; 122 | coutFmt('Elapsed %s to insert %d records',[crono.ElapsedTime,i-1],etSuccess); 123 | cout('< Press a key to continue to next test >',etTrace); 124 | Readln; 125 | 126 | //get users 127 | cout('Where query...',etInfo); 128 | //User := TUser.Create(DAODatabase,'IdUser > ?',[0]); 129 | //User := TUser.Create(DAODatabase,'Age > ? AND Age < ?',[30,35]); 130 | iresult := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).SelectTop(10); 131 | for User in iresult do 132 | begin 133 | cout('IdUser: %d Name: %s %s Age: %d Genre: %d LastInfo: %s',[User.IdUser,User.Name,User.Surname,User.Age,Ord(User.Genre),DateTimetoStr(User.LastInfo)],etSuccess); 134 | User.Free; 135 | end; 136 | cout('Query results: %s',[NumberToStr(iresult.Count)],etInfo); 137 | 138 | cout('< Press a key to continue to next test >',etTrace); 139 | Readln; 140 | 141 | //modify user 142 | cout('Modify a existing User...',etInfo); 143 | User := DAODatabase.From.Where('IdUser = ?',[1]).SelectFirst; 144 | try 145 | if User <> nil then 146 | begin 147 | cout('Found -> IdUser: %d Name: %s %s Age: %d',[User.IdUser,User.Name,User.Surname,User.Age],etInfo); 148 | User.Age := 30; 149 | User.Active := True; 150 | DAODatabase.Update(User); 151 | end 152 | else cout('Can''t found this User',etError); 153 | finally 154 | User.Free; 155 | end; 156 | 157 | cout('Count total Users...',etInfo); 158 | coutFmt('Num users in DB: %s',[NumberToStr(DAODatabase.From.Count)],etInfo); 159 | 160 | cout('< Press a key to Exit >',etInfo); 161 | ConsoleWaitForEnterKey; 162 | DAODatabase.Free; 163 | crono.Free; 164 | except 165 | on E: Exception do 166 | Writeln(E.ClassName, ': ', E.Message); 167 | end; 168 | end. 169 | -------------------------------------------------------------------------------- /samples/delphi/MSAccess/DAOMSAccess.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {0B96B689-1185-47A4-8CE9-EF73D5DD5EA1} 4 | 18.7 5 | None 6 | DAOMSAccess.dpr 7 | True 8 | Debug 9 | Win32 10 | 3 11 | Console 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Cfg_1 59 | true 60 | true 61 | 62 | 63 | true 64 | Base 65 | true 66 | 67 | 68 | .\$(Platform)\$(Config) 69 | .\$(Platform)\$(Config) 70 | false 71 | false 72 | false 73 | false 74 | false 75 | RESTComponents;FireDACIBDriver;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;FireDAC;FireDACSqliteDriver;soaprtl;soapmidas;$(DCC_UsePackage) 76 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 77 | DAOMSAccess 78 | 79 | 80 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;$(DCC_UsePackage) 81 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 82 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 83 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 84 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 85 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 86 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 87 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 88 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 89 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 90 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar 91 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png 92 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png 93 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png 94 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png 95 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png 96 | 97 | 98 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 99 | 100 | 101 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FrameViewer;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSFMXPackPkgDXE11;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 102 | 103 | 104 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 105 | 106 | 107 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;inetdb;FmxTeeUI;fmx;fmxdae;dbexpress;IndyCore;dsnap;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;fmxobj;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage) 108 | true 109 | 110 | 111 | DBXSqliteDriver;UbuntuProgressPackage;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;svnui;JvGlobus;FireDACADSDriver;JvPluginSystem;JvMM;tmsxlsdXE11;vcltouch;JvBands;vcldb;bindcompfmx;svn;Intraweb;JvJans;JvNet;inetdb;JvAppFrm;EssentialsDR;vcwdedXE11;vcwdXE11;FmxTeeUI;JvDotNetCtrls;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;JvWizards;tmsexdXE11;dbexpress;IndyCore;vclx;JvPageComps;dsnap;JvDB;VCLRESTComponents;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;JvCmp;FireDACMySQLDriver;JvHMI;FireDACCommonODBC;LockBoxDR;bindcompdbx;IndyIPCommon;JvCustom;advchartdedxe11;vcl;IndyIPServer;GR32_D;JvXPCtrls;PngComponents;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;Jcl;FrameViewer;JvCore;JvCrypt;FireDACPgDriver;ibmonitor;FMXTee;SevenZippro;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;xmlrtl;ibxbindings;fmxobj;vclwinx;JvTimeFramework;rtl;GR32_R;DbxClientDriver;CustomIPTransport;vcldsnap;JvSystem;JvStdCtrls;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;tmswizdXE11;nTrayIcon;IndyIPClient;bindcompvcl;TeeUI;TMSFMXPackPkgDXE11;JvDocking;dbxcds;VclSmp;JvPascalInterpreter;adortl;KernowSoftwareFMX;JclVcl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) 112 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 113 | Debug 114 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 115 | 1033 116 | true 117 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 118 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 119 | 120 | 121 | DBXSqliteDriver;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;vcltouch;vcldb;bindcompfmx;Intraweb;inetdb;EssentialsDR;vcwdXE11;FmxTeeUI;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;tmsexdXE11;dbexpress;IndyCore;vclx;dsnap;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;Tee;xmlrtl;ibxbindings;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage) 122 | true 123 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 124 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 125 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) 126 | Debug 127 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 128 | 1033 129 | 130 | 131 | DEBUG;$(DCC_Define) 132 | true 133 | false 134 | true 135 | true 136 | true 137 | 138 | 139 | false 140 | 141 | 142 | false 143 | RELEASE;$(DCC_Define) 144 | 0 145 | 0 146 | 147 | 148 | 149 | MainSource 150 | 151 | 152 | Cfg_2 153 | Base 154 | 155 | 156 | Base 157 | 158 | 159 | Cfg_1 160 | Base 161 | 162 | 163 | 164 | Delphi.Personality.12 165 | Application 166 | 167 | 168 | 169 | DAOMSAccess.dpr 170 | 171 | 172 | 173 | 174 | 175 | true 176 | 177 | 178 | 179 | 180 | true 181 | 182 | 183 | 184 | 185 | true 186 | 187 | 188 | 189 | 190 | true 191 | 192 | 193 | 194 | 195 | true 196 | 197 | 198 | 199 | 200 | true 201 | 202 | 203 | 204 | 205 | DAOMSAccess.exe 206 | true 207 | 208 | 209 | 210 | 211 | 1 212 | 213 | 214 | Contents\MacOS 215 | 1 216 | 217 | 218 | 0 219 | 220 | 221 | 222 | 223 | classes 224 | 1 225 | 226 | 227 | 228 | 229 | res\xml 230 | 1 231 | 232 | 233 | 234 | 235 | library\lib\armeabi-v7a 236 | 1 237 | 238 | 239 | 240 | 241 | library\lib\armeabi 242 | 1 243 | 244 | 245 | 246 | 247 | library\lib\mips 248 | 1 249 | 250 | 251 | 252 | 253 | library\lib\armeabi-v7a 254 | 1 255 | 256 | 257 | 258 | 259 | res\drawable 260 | 1 261 | 262 | 263 | 264 | 265 | res\values 266 | 1 267 | 268 | 269 | 270 | 271 | res\values-v21 272 | 1 273 | 274 | 275 | 276 | 277 | res\values 278 | 1 279 | 280 | 281 | 282 | 283 | res\drawable 284 | 1 285 | 286 | 287 | 288 | 289 | res\drawable-xxhdpi 290 | 1 291 | 292 | 293 | 294 | 295 | res\drawable-ldpi 296 | 1 297 | 298 | 299 | 300 | 301 | res\drawable-mdpi 302 | 1 303 | 304 | 305 | 306 | 307 | res\drawable-hdpi 308 | 1 309 | 310 | 311 | 312 | 313 | res\drawable-xhdpi 314 | 1 315 | 316 | 317 | 318 | 319 | res\drawable-mdpi 320 | 1 321 | 322 | 323 | 324 | 325 | res\drawable-hdpi 326 | 1 327 | 328 | 329 | 330 | 331 | res\drawable-xhdpi 332 | 1 333 | 334 | 335 | 336 | 337 | res\drawable-xxhdpi 338 | 1 339 | 340 | 341 | 342 | 343 | res\drawable-xxxhdpi 344 | 1 345 | 346 | 347 | 348 | 349 | res\drawable-small 350 | 1 351 | 352 | 353 | 354 | 355 | res\drawable-normal 356 | 1 357 | 358 | 359 | 360 | 361 | res\drawable-large 362 | 1 363 | 364 | 365 | 366 | 367 | res\drawable-xlarge 368 | 1 369 | 370 | 371 | 372 | 373 | res\values 374 | 1 375 | 376 | 377 | 378 | 379 | 1 380 | 381 | 382 | Contents\MacOS 383 | 1 384 | 385 | 386 | 0 387 | 388 | 389 | 390 | 391 | Contents\MacOS 392 | 1 393 | .framework 394 | 395 | 396 | Contents\MacOS 397 | 1 398 | .framework 399 | 400 | 401 | 0 402 | 403 | 404 | 405 | 406 | 1 407 | .dylib 408 | 409 | 410 | 1 411 | .dylib 412 | 413 | 414 | 1 415 | .dylib 416 | 417 | 418 | Contents\MacOS 419 | 1 420 | .dylib 421 | 422 | 423 | Contents\MacOS 424 | 1 425 | .dylib 426 | 427 | 428 | 0 429 | .dll;.bpl 430 | 431 | 432 | 433 | 434 | 1 435 | .dylib 436 | 437 | 438 | 1 439 | .dylib 440 | 441 | 442 | 1 443 | .dylib 444 | 445 | 446 | Contents\MacOS 447 | 1 448 | .dylib 449 | 450 | 451 | Contents\MacOS 452 | 1 453 | .dylib 454 | 455 | 456 | 0 457 | .bpl 458 | 459 | 460 | 461 | 462 | 0 463 | 464 | 465 | 0 466 | 467 | 468 | 0 469 | 470 | 471 | 0 472 | 473 | 474 | Contents\Resources\StartUp\ 475 | 0 476 | 477 | 478 | Contents\Resources\StartUp\ 479 | 0 480 | 481 | 482 | 0 483 | 484 | 485 | 486 | 487 | 1 488 | 489 | 490 | 1 491 | 492 | 493 | 1 494 | 495 | 496 | 497 | 498 | 1 499 | 500 | 501 | 1 502 | 503 | 504 | 1 505 | 506 | 507 | 508 | 509 | 1 510 | 511 | 512 | 1 513 | 514 | 515 | 1 516 | 517 | 518 | 519 | 520 | 1 521 | 522 | 523 | 1 524 | 525 | 526 | 1 527 | 528 | 529 | 530 | 531 | 1 532 | 533 | 534 | 1 535 | 536 | 537 | 1 538 | 539 | 540 | 541 | 542 | 1 543 | 544 | 545 | 1 546 | 547 | 548 | 1 549 | 550 | 551 | 552 | 553 | 1 554 | 555 | 556 | 1 557 | 558 | 559 | 1 560 | 561 | 562 | 563 | 564 | 1 565 | 566 | 567 | 1 568 | 569 | 570 | 1 571 | 572 | 573 | 574 | 575 | 1 576 | 577 | 578 | 1 579 | 580 | 581 | 1 582 | 583 | 584 | 585 | 586 | 1 587 | 588 | 589 | 1 590 | 591 | 592 | 1 593 | 594 | 595 | 596 | 597 | 1 598 | 599 | 600 | 1 601 | 602 | 603 | 1 604 | 605 | 606 | 607 | 608 | 1 609 | 610 | 611 | 1 612 | 613 | 614 | 1 615 | 616 | 617 | 618 | 619 | 1 620 | 621 | 622 | 1 623 | 624 | 625 | 1 626 | 627 | 628 | 629 | 630 | 1 631 | 632 | 633 | 1 634 | 635 | 636 | 1 637 | 638 | 639 | 640 | 641 | 1 642 | 643 | 644 | 1 645 | 646 | 647 | 1 648 | 649 | 650 | 651 | 652 | 1 653 | 654 | 655 | 1 656 | 657 | 658 | 1 659 | 660 | 661 | 662 | 663 | 1 664 | 665 | 666 | 1 667 | 668 | 669 | 1 670 | 671 | 672 | 673 | 674 | 1 675 | 676 | 677 | 1 678 | 679 | 680 | 1 681 | 682 | 683 | 684 | 685 | 1 686 | 687 | 688 | 1 689 | 690 | 691 | 1 692 | 693 | 694 | 695 | 696 | 1 697 | 698 | 699 | 1 700 | 701 | 702 | 1 703 | 704 | 705 | 706 | 707 | 1 708 | 709 | 710 | 1 711 | 712 | 713 | 1 714 | 715 | 716 | 717 | 718 | 1 719 | 720 | 721 | 1 722 | 723 | 724 | 1 725 | 726 | 727 | 728 | 729 | 1 730 | 731 | 732 | 1 733 | 734 | 735 | 1 736 | 737 | 738 | 739 | 740 | 1 741 | 742 | 743 | 1 744 | 745 | 746 | 1 747 | 748 | 749 | 750 | 751 | 1 752 | 753 | 754 | 1 755 | 756 | 757 | 1 758 | 759 | 760 | 761 | 762 | 1 763 | 764 | 765 | 1 766 | 767 | 768 | 1 769 | 770 | 771 | 772 | 773 | 1 774 | 775 | 776 | 1 777 | 778 | 779 | 1 780 | 781 | 782 | 783 | 784 | 1 785 | 786 | 787 | 1 788 | 789 | 790 | 1 791 | 792 | 793 | 794 | 795 | 1 796 | 797 | 798 | 799 | 800 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 801 | 1 802 | 803 | 804 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 805 | 1 806 | 807 | 808 | 809 | 810 | 1 811 | 812 | 813 | 1 814 | 815 | 816 | 817 | 818 | ..\ 819 | 1 820 | 821 | 822 | ..\ 823 | 1 824 | 825 | 826 | 827 | 828 | 1 829 | 830 | 831 | 1 832 | 833 | 834 | 1 835 | 836 | 837 | 838 | 839 | 1 840 | 841 | 842 | 1 843 | 844 | 845 | 1 846 | 847 | 848 | 849 | 850 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 851 | 1 852 | 853 | 854 | 855 | 856 | ..\ 857 | 1 858 | 859 | 860 | ..\ 861 | 1 862 | 863 | 864 | 865 | 866 | Contents 867 | 1 868 | 869 | 870 | Contents 871 | 1 872 | 873 | 874 | 875 | 876 | Contents\Resources 877 | 1 878 | 879 | 880 | Contents\Resources 881 | 1 882 | 883 | 884 | 885 | 886 | library\lib\armeabi-v7a 887 | 1 888 | 889 | 890 | 1 891 | 892 | 893 | 1 894 | 895 | 896 | 1 897 | 898 | 899 | 1 900 | 901 | 902 | Contents\MacOS 903 | 1 904 | 905 | 906 | Contents\MacOS 907 | 1 908 | 909 | 910 | 0 911 | 912 | 913 | 914 | 915 | 1 916 | 917 | 918 | 1 919 | 920 | 921 | 922 | 923 | Assets 924 | 1 925 | 926 | 927 | Assets 928 | 1 929 | 930 | 931 | 932 | 933 | Assets 934 | 1 935 | 936 | 937 | Assets 938 | 1 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | False 953 | False 954 | False 955 | False 956 | False 957 | True 958 | True 959 | 960 | 961 | 12 962 | 963 | 964 | 965 | 966 | 967 | -------------------------------------------------------------------------------- /samples/delphi/MSAccess/DAOMSAccess.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/samples/delphi/MSAccess/DAOMSAccess.res -------------------------------------------------------------------------------- /samples/delphi/MSSQL/DAOMSSQL.dpr: -------------------------------------------------------------------------------- 1 | program DAOMSSQL; 2 | 3 | {$APPTYPE CONSOLE} 4 | 5 | {$R *.res} 6 | 7 | uses 8 | System.SysUtils, 9 | Quick.Commons, 10 | Quick.Console, 11 | Quick.Chrono, 12 | Quick.DAO, 13 | Quick.DAO.Engine.ADO; 14 | 15 | type 16 | TGenre = (gMale, gFemale); 17 | 18 | TConnection = class 19 | private 20 | fIdConnection : Integer; 21 | fConnectionDate : TDateTime; 22 | published 23 | property IdConnection : Integer read fIdConnection write fIdConnection; 24 | property ConnectionDate : TDateTime read fConnectionDate write fConnectionDate; 25 | end; 26 | 27 | TConnections = array of TConnection; 28 | 29 | TGroups = array of Int64; 30 | 31 | TLocation = record 32 | Street : string; 33 | Number : Integer; 34 | City : string; 35 | end; 36 | 37 | TUser = class(TDAORecord) 38 | private 39 | fIdUser : TAutoID; 40 | fName : string; 41 | fSurname : string; 42 | fAge : Integer; 43 | fActive : Boolean; 44 | fGenre : TGenre; 45 | fMoney : Double; 46 | fLastInfo : TDateTime; 47 | fGroups : TGroups; 48 | fLocation : TLocation; 49 | //fConnections : TConnections; 50 | published 51 | property IdUser : TAutoID read fIdUser write fIdUser; 52 | //[TFieldVARCHAR(50)] 53 | property Name : string index 50 read fName write fName; 54 | [TFieldVARCHAR(255)] 55 | property Surname : string read fSurname write fSurname; 56 | //[TMapField('UserAge')] 57 | property Age : Integer read fAge write fAge; 58 | property Active : Boolean read fActive write fActive; 59 | property Genre : TGenre read fGenre write fGenre; 60 | //[TFieldDECIMAL(10,2)] 61 | property Money : Double index 2 read fMoney write fMoney; 62 | property LastInfo : TDateTime read fLastInfo write fLastInfo; 63 | property Groups : TGroups read fGroups write fGroups; 64 | property Location : TLocation read fLocation write fLocation; 65 | //property Connections : TConnections read fConnections write fConnections; 66 | end; 67 | 68 | const 69 | UserNames : array of string = ['Cliff','Alan','Anna','Phil','John','Michel','Jennifer','Peter','Brandon','Joe','Steve','Lorraine','Bill','Tom']; 70 | UserSurnames : array of string = ['Gordon','Summer','Huan','Paterson','Johnson','Michelson','Smith','Peterson','Miller','McCarney','Roller','Gonzalez','Thomson','Muller']; 71 | 72 | var 73 | DAODatabase : TDAODataBaseADO; 74 | User : TUser; 75 | iresult : IDAOResult; 76 | NumUsers : Integer; 77 | i : Integer; 78 | crono : TChronometer; 79 | location : TLocation; 80 | 81 | begin 82 | try 83 | ReportMemoryLeaksOnShutdown := True; 84 | crono := TChronometer.Create(False); 85 | 86 | DAODatabase := TDAODataBaseADO.Create; 87 | DAODatabase.Connection.Provider := TDBProvider.daoMSSQL; 88 | DAODatabase.Connection.Server := 'localhost'; 89 | DAODatabase.Connection.Database := 'Test'; 90 | DAODatabase.Connection.UserName := 'myuser'; 91 | DAODatabase.Connection.Password := '1234'; 92 | DAODatabase.Models.Add(TUser,'IdUser'); 93 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 94 | if DAODatabase.Connect then cout('Connected to database',etSuccess) 95 | else cout('Can''t connect to database',etError); 96 | 97 | NumUsers := 100; 98 | 99 | cout('Adding %d users to db...',[NumUsers],etInfo); 100 | crono.Start; 101 | //create random records 102 | User := TUser.Create; 103 | try 104 | for i := 1 to NumUsers do 105 | begin 106 | //User.IdUser := Random(999999999999999); 107 | User.Name := UserNames[Random(High(UserNames))]; 108 | User.Surname := UserSurnames[Random(High(UserSurnames))] + ' ' + UserSurnames[Random(High(UserSurnames))];; 109 | User.Age := Random(30)+18; 110 | User.Genre := TGenre(Random(1)); 111 | User.LastInfo := Now(); 112 | User.Money := Random(50000); 113 | User.Active := True; 114 | User.Groups := [1,2,3,4,5,6,7]; 115 | location.Street := 'Main St'; 116 | location.Number := 1; 117 | location.City := 'London'; 118 | User.Location := location; 119 | DAODatabase.Add(User); 120 | end; 121 | finally 122 | User.Free; 123 | end; 124 | crono.Stop; 125 | coutFmt('Elapsed %s to insert %d records',[crono.ElapsedTime,NumUsers],etSuccess); 126 | cout('< Press a key to continue to next test >',etTrace); 127 | Readln; 128 | 129 | //get users 130 | cout('Where query...',etInfo); 131 | //User := TUser.Create(DAODatabase,'IdUser > ?',[0]); 132 | //User := TUser.Create(DAODatabase,'Age > ? AND Age < ?',[30,35]); 133 | iresult := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).OrderBy('Name,Surname').SelectTop(10); 134 | for User in iresult do 135 | begin 136 | cout('IdUser: %d Name: %s %s Age: %d Genre: %d LastInfo: %s',[User.IdUser,User.Name,User.Surname,User.Age,Ord(User.Genre),DateTimetoStr(User.LastInfo)],etSuccess); 137 | User.Free; 138 | end; 139 | cout('Query results: %s',[NumberToStr(iresult.Count)],etInfo); 140 | 141 | cout('< Press a key to continue to next test >',etTrace); 142 | Readln; 143 | 144 | //modify user 145 | cout('Modify a existing User...',etInfo); 146 | //User := DAODatabase.From.Where('IdUser = ?',[1]).SelectFirst; 147 | user := DAODatabase.From.Where('Name = ?',['Alan']).SelectFirst; 148 | try 149 | if User <> nil then 150 | begin 151 | cout('Found -> IdUser: %d Name: %s %s Age: %d',[User.IdUser,User.Name,User.Surname,User.Age],etInfo); 152 | User.Age := 30; 153 | User.Active := True; 154 | DAODatabase.Update(User); 155 | end 156 | else cout('Can''t found this User',etError); 157 | finally 158 | User.Free; 159 | end; 160 | 161 | cout('Count total Users...',etInfo); 162 | coutFmt('Num users in DB: %s',[NumberToStr(DAODatabase.From.Count)],etInfo); 163 | 164 | cout('< Press a key to Exit >',etInfo); 165 | ConsoleWaitForEnterKey; 166 | DAODatabase.Free; 167 | crono.Free; 168 | except 169 | on E: Exception do 170 | Writeln(E.ClassName, ': ', E.Message); 171 | end; 172 | end. 173 | -------------------------------------------------------------------------------- /samples/delphi/MSSQL/DAOMSSQL.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/samples/delphi/MSSQL/DAOMSSQL.res -------------------------------------------------------------------------------- /samples/delphi/SQLite/DAOSQLite.dpr: -------------------------------------------------------------------------------- 1 | program DAOSQLite; 2 | 3 | {$APPTYPE CONSOLE} 4 | 5 | {$R *.res} 6 | 7 | uses 8 | System.SysUtils, 9 | Quick.Commons, 10 | Quick.Console, 11 | Quick.Chrono, 12 | Quick.DAO, 13 | Quick.DAO.Engine.FireDAC; 14 | //Quick.DAO.Engine.SQLite3; 15 | 16 | type 17 | TGenre = (gMale, gFemale); 18 | 19 | TConnection = class 20 | private 21 | fIdConnection : Integer; 22 | fConnectionDate : TDateTime; 23 | published 24 | property IdConnection : Integer read fIdConnection write fIdConnection; 25 | property ConnectionDate : TDateTime read fConnectionDate write fConnectionDate; 26 | end; 27 | 28 | TConnections = array of TConnection; 29 | 30 | TGroups = array of Int64; 31 | 32 | TLocation = record 33 | Street : string; 34 | Number : Integer; 35 | City : string; 36 | end; 37 | 38 | TUser = class(TDAORecordTS) 39 | private 40 | fIdUser : TAutoID; 41 | fName : string; 42 | fSurname : string; 43 | fAge : Integer; 44 | fActive : Boolean; 45 | fGenre : TGenre; 46 | fMoney : Double; 47 | fLastInfo : TDateTime; 48 | fGroups : TGroups; 49 | fLocation : TLocation; 50 | //fConnections : TConnections; 51 | published 52 | property IdUser : TAutoID read fIdUser write fIdUser; 53 | //[TFieldVARCHAR(50)] 54 | property Name : string index 50 read fName write fName; 55 | [TFieldVARCHAR(255)] 56 | property Surname : string read fSurname write fSurname; 57 | //[TMapField('UserAge')] 58 | property Age : Integer read fAge write fAge; 59 | property Active : Boolean read fActive write fActive; 60 | property Genre : TGenre read fGenre write fGenre; 61 | //[TFieldDECIMAL(10,2)] 62 | property Money : Double index 2 read fMoney write fMoney; 63 | property LastInfo : TDateTime read fLastInfo write fLastInfo; 64 | property Groups : TGroups read fGroups write fGroups; 65 | property Location : TLocation read fLocation write fLocation; 66 | //property Connections : TConnections read fConnections write fConnections; 67 | end; 68 | 69 | const 70 | UserNames : array of string = ['Cliff','Alan','Anna','Phil','John','Michel','Jennifer','Peter','Brandon','Joe','Steve','Lorraine','Bill','Tom']; 71 | UserSurnames : array of string = ['Gordon','Summer','Huan','Paterson','Johnson','Michelson','Smith','Peterson','Miller','McCarney','Roller','Gonzalez','Thomson','Muller']; 72 | 73 | var 74 | DAODatabase : TDAODataBaseFireDAC; 75 | User : TUser; 76 | iresult : IDAOResult; 77 | NumUsers : Integer; 78 | i : Integer; 79 | crono : TChronometer; 80 | location : TLocation; 81 | begin 82 | try 83 | ReportMemoryLeaksOnShutdown := True; 84 | crono := TChronometer.Create(False); 85 | 86 | DAODatabase := TDAODataBaseFireDAC.Create; 87 | DAODatabase.Connection.Provider := TDBProvider.daoSQLite; 88 | DAODatabase.Connection.Database := '.\test.db3'; 89 | DAODatabase.Models.PluralizeTableNames := True; 90 | DAODatabase.Models.Add(TUser,'IdUser'); 91 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 92 | if DAODatabase.Connect then cout('Connected to database',etSuccess) 93 | else cout('Can''t connect to database',etError); 94 | 95 | NumUsers := 100; 96 | 97 | cout('Adding %d users to db...',[NumUsers],etInfo); 98 | crono.Start; 99 | //create random records 100 | User := TUser.Create; 101 | try 102 | for i := 1 to NumUsers do 103 | begin 104 | //User.IdUser := Random(999999999999999); 105 | User.Name := UserNames[Random(High(UserNames))]; 106 | User.Surname := UserSurnames[Random(High(UserSurnames))] + ' ' + UserSurnames[Random(High(UserSurnames))];; 107 | User.Age := Random(30)+18; 108 | User.Genre := TGenre(Random(1)); 109 | User.LastInfo := Now(); 110 | User.Money := Random(50000); 111 | User.Active := True; 112 | User.Groups := [1,2,3,4,5,6,7]; 113 | location.Street := 'Main St'; 114 | location.Number := 1; 115 | location.City := 'London'; 116 | User.Location := location; 117 | DAODatabase.Add(User); 118 | end; 119 | finally 120 | User.Free; 121 | end; 122 | crono.Stop; 123 | coutFmt('Elapsed %s to insert %d records (Total in DB = %s)',[crono.ElapsedTime,NumUsers,NumberToStr(DAODatabase.From.Count)],etSuccess); 124 | cout('< Press a key to continue to next test >',etTrace); 125 | Readln; 126 | 127 | //get users 128 | cout('Where query...',etInfo); 129 | //User := TUser.Create(DAODatabase,'IdUser > ?',[0]); 130 | //User := TUser.Create(DAODatabase,'Age > ? AND Age < ?',[30,35]); 131 | iresult := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).OrderBy('Name').SelectTop(10); 132 | //iresult := DAODatabase.From.Where('Name = ?',['Anna']).SelectTop(10); 133 | for User in iresult do 134 | begin 135 | cout('IdUser: %d Name: %s %s Age: %d Genre: %d LastInfo: %s',[User.IdUser,User.Name,User.Surname,User.Age,Ord(User.Genre),DateTimetoStr(User.LastInfo)],etSuccess); 136 | User.Free; 137 | end; 138 | cout('Query results: %s',[NumberToStr(iresult.Count)],etInfo); 139 | 140 | cout('< Press a key to continue to next test >',etTrace); 141 | Readln; 142 | 143 | //modify user 144 | cout('Modify a existing User...',etInfo); 145 | User := DAODatabase.From.Where('IdUser = ?',[1]).SelectFirst; 146 | try 147 | if User <> nil then 148 | begin 149 | cout('Found -> IdUser: %d Name: %s %s Age: %d',[User.IdUser,User.Name,User.Surname,User.Age],etInfo); 150 | User.Age := 30; 151 | User.Active := True; 152 | DAODatabase.Update(User); 153 | end 154 | else cout('Can''t found this User',etError); 155 | finally 156 | User.Free; 157 | end; 158 | 159 | cout('Count total Users...',etInfo); 160 | coutFmt('Num users in DB: %s',[NumberToStr(DAODatabase.From.Count)],etInfo); 161 | 162 | cout('< Press a key to Exit >',etInfo); 163 | ConsoleWaitForEnterKey; 164 | DAODatabase.Free; 165 | crono.Free; 166 | except 167 | on E: Exception do 168 | Writeln(E.ClassName, ': ', E.Message); 169 | end; 170 | end. 171 | -------------------------------------------------------------------------------- /samples/delphi/SQLite/DAOSQLite.dproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | {0B96B689-1185-47A4-8CE9-EF73D5DD5EA1} 4 | 18.7 5 | None 6 | DAOSQLite.dpr 7 | True 8 | Debug 9 | Win32 10 | 1 11 | Console 12 | 13 | 14 | true 15 | 16 | 17 | true 18 | Base 19 | true 20 | 21 | 22 | true 23 | Base 24 | true 25 | 26 | 27 | true 28 | Base 29 | true 30 | 31 | 32 | true 33 | Base 34 | true 35 | 36 | 37 | true 38 | Base 39 | true 40 | 41 | 42 | true 43 | Base 44 | true 45 | 46 | 47 | true 48 | Base 49 | true 50 | 51 | 52 | true 53 | Base 54 | true 55 | 56 | 57 | true 58 | Cfg_1 59 | true 60 | true 61 | 62 | 63 | true 64 | Base 65 | true 66 | 67 | 68 | .\$(Platform)\$(Config) 69 | .\$(Platform)\$(Config) 70 | false 71 | false 72 | false 73 | false 74 | false 75 | RESTComponents;FireDACIBDriver;FireDACCommon;RESTBackendComponents;soapserver;CloudService;FireDACCommonDriver;inet;FireDAC;FireDACSqliteDriver;soaprtl;soapmidas;$(DCC_UsePackage) 76 | System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) 77 | DAOSQLite 78 | 79 | 80 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;CoolTrayIcon_D210_XE7;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;$(DCC_UsePackage) 81 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png 82 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png 83 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png 84 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png 85 | $(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png 86 | $(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png 87 | $(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png 88 | $(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png 89 | $(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png 90 | android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services-ads-7.0.0.dex.jar;google-play-services-analytics-7.0.0.dex.jar;google-play-services-base-7.0.0.dex.jar;google-play-services-identity-7.0.0.dex.jar;google-play-services-maps-7.0.0.dex.jar;google-play-services-panorama-7.0.0.dex.jar;google-play-services-plus-7.0.0.dex.jar;google-play-services-wallet-7.0.0.dex.jar 91 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png 92 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png 93 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png 94 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png 95 | $(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png 96 | 97 | 98 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 99 | 100 | 101 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FrameViewer;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;TMSFMXPackPkgDXE11;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 102 | 103 | 104 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;FmxTeeUI;fmx;dbexpress;IndyCore;dsnap;bindengine;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;IndyProtocols;fmxase;$(DCC_UsePackage) 105 | 106 | 107 | DBXSqliteDriver;DBXInterBaseDriver;tethering;bindcompfmx;inetdb;FmxTeeUI;fmx;fmxdae;dbexpress;IndyCore;dsnap;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;IndyIPServer;IndySystem;fmxFireDAC;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;xmlrtl;ibxbindings;fmxobj;rtl;DbxClientDriver;CustomIPTransport;bindcomp;IndyIPClient;dbxcds;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage) 108 | true 109 | 110 | 111 | DBXSqliteDriver;UbuntuProgressPackage;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;svnui;JvGlobus;FireDACADSDriver;JvPluginSystem;JvMM;tmsxlsdXE11;vcltouch;JvBands;vcldb;bindcompfmx;svn;Intraweb;JvJans;JvNet;inetdb;JvAppFrm;EssentialsDR;vcwdedXE11;vcwdXE11;FmxTeeUI;JvDotNetCtrls;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;JvWizards;tmsexdXE11;dbexpress;IndyCore;vclx;JvPageComps;dsnap;JvDB;VCLRESTComponents;JclDeveloperTools;vclie;bindengine;DBXMySQLDriver;JvCmp;FireDACMySQLDriver;JvHMI;FireDACCommonODBC;LockBoxDR;bindcompdbx;IndyIPCommon;JvCustom;advchartdedxe11;vcl;IndyIPServer;GR32_D;JvXPCtrls;PngComponents;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;madBasic_;TeeDB;Jcl;FrameViewer;JvCore;JvCrypt;FireDACPgDriver;ibmonitor;FMXTee;SevenZippro;DbxCommonDriver;JvDlgs;JvRuntimeDesign;ibxpress;Tee;JvManagedThreads;xmlrtl;ibxbindings;fmxobj;vclwinx;JvTimeFramework;rtl;GR32_R;DbxClientDriver;CustomIPTransport;vcldsnap;JvSystem;JvStdCtrls;bindcomp;appanalytics;CoolTrayIcon_D210_XE7;tmswizdXE11;nTrayIcon;IndyIPClient;bindcompvcl;TeeUI;TMSFMXPackPkgDXE11;JvDocking;dbxcds;VclSmp;JvPascalInterpreter;adortl;KernowSoftwareFMX;JclVcl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;JvControls;JvPrintPreview;Analog_XE7;JclContainers;fmxase;$(DCC_UsePackage) 112 | Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 113 | Debug 114 | CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= 115 | 1033 116 | true 117 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 118 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 119 | 120 | 121 | DBXSqliteDriver;DBXInterBaseDriver;vclactnband;vclFireDAC;tethering;FireDACADSDriver;vcltouch;vcldb;bindcompfmx;Intraweb;inetdb;EssentialsDR;vcwdXE11;FmxTeeUI;AbbreviaVCLD;fmx;fmxdae;tmsdXE11;vclib;tmsexdXE11;dbexpress;IndyCore;vclx;dsnap;VCLRESTComponents;vclie;bindengine;DBXMySQLDriver;FireDACMySQLDriver;FireDACCommonODBC;bindcompdbx;IndyIPCommon;vcl;IndyIPServer;IndySystem;advchartdxe11;dsnapcon;FireDACMSAccDriver;fmxFireDAC;vclimg;TeeDB;FireDACPgDriver;ibmonitor;FMXTee;DbxCommonDriver;ibxpress;Tee;xmlrtl;ibxbindings;fmxobj;vclwinx;rtl;DbxClientDriver;CustomIPTransport;vcldsnap;bindcomp;appanalytics;IndyIPClient;bindcompvcl;TeeUI;dbxcds;VclSmp;adortl;dsnapxml;dbrtl;inetdbxpress;IndyProtocols;fmxase;$(DCC_UsePackage) 122 | true 123 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png 124 | $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png 125 | 126 | 127 | DEBUG;$(DCC_Define) 128 | true 129 | false 130 | true 131 | true 132 | true 133 | 134 | 135 | false 136 | 137 | 138 | false 139 | RELEASE;$(DCC_Define) 140 | 0 141 | 0 142 | 143 | 144 | 145 | MainSource 146 | 147 | 148 | Cfg_2 149 | Base 150 | 151 | 152 | Base 153 | 154 | 155 | Cfg_1 156 | Base 157 | 158 | 159 | 160 | Delphi.Personality.12 161 | Application 162 | 163 | 164 | 165 | DAOSQLite.dpr 166 | 167 | 168 | 169 | 170 | 171 | true 172 | 173 | 174 | 175 | 176 | DAOSQLite.exe 177 | true 178 | 179 | 180 | 181 | 182 | true 183 | 184 | 185 | 186 | 187 | true 188 | 189 | 190 | 191 | 192 | true 193 | 194 | 195 | 196 | 197 | true 198 | 199 | 200 | 201 | 202 | true 203 | 204 | 205 | 206 | 207 | 1 208 | 209 | 210 | Contents\MacOS 211 | 1 212 | 213 | 214 | 0 215 | 216 | 217 | 218 | 219 | classes 220 | 1 221 | 222 | 223 | 224 | 225 | res\xml 226 | 1 227 | 228 | 229 | 230 | 231 | library\lib\armeabi-v7a 232 | 1 233 | 234 | 235 | 236 | 237 | library\lib\armeabi 238 | 1 239 | 240 | 241 | 242 | 243 | library\lib\mips 244 | 1 245 | 246 | 247 | 248 | 249 | library\lib\armeabi-v7a 250 | 1 251 | 252 | 253 | 254 | 255 | res\drawable 256 | 1 257 | 258 | 259 | 260 | 261 | res\values 262 | 1 263 | 264 | 265 | 266 | 267 | res\values-v21 268 | 1 269 | 270 | 271 | 272 | 273 | res\values 274 | 1 275 | 276 | 277 | 278 | 279 | res\drawable 280 | 1 281 | 282 | 283 | 284 | 285 | res\drawable-xxhdpi 286 | 1 287 | 288 | 289 | 290 | 291 | res\drawable-ldpi 292 | 1 293 | 294 | 295 | 296 | 297 | res\drawable-mdpi 298 | 1 299 | 300 | 301 | 302 | 303 | res\drawable-hdpi 304 | 1 305 | 306 | 307 | 308 | 309 | res\drawable-xhdpi 310 | 1 311 | 312 | 313 | 314 | 315 | res\drawable-mdpi 316 | 1 317 | 318 | 319 | 320 | 321 | res\drawable-hdpi 322 | 1 323 | 324 | 325 | 326 | 327 | res\drawable-xhdpi 328 | 1 329 | 330 | 331 | 332 | 333 | res\drawable-xxhdpi 334 | 1 335 | 336 | 337 | 338 | 339 | res\drawable-xxxhdpi 340 | 1 341 | 342 | 343 | 344 | 345 | res\drawable-small 346 | 1 347 | 348 | 349 | 350 | 351 | res\drawable-normal 352 | 1 353 | 354 | 355 | 356 | 357 | res\drawable-large 358 | 1 359 | 360 | 361 | 362 | 363 | res\drawable-xlarge 364 | 1 365 | 366 | 367 | 368 | 369 | res\values 370 | 1 371 | 372 | 373 | 374 | 375 | 1 376 | 377 | 378 | Contents\MacOS 379 | 1 380 | 381 | 382 | 0 383 | 384 | 385 | 386 | 387 | Contents\MacOS 388 | 1 389 | .framework 390 | 391 | 392 | Contents\MacOS 393 | 1 394 | .framework 395 | 396 | 397 | 0 398 | 399 | 400 | 401 | 402 | 1 403 | .dylib 404 | 405 | 406 | 1 407 | .dylib 408 | 409 | 410 | 1 411 | .dylib 412 | 413 | 414 | Contents\MacOS 415 | 1 416 | .dylib 417 | 418 | 419 | Contents\MacOS 420 | 1 421 | .dylib 422 | 423 | 424 | 0 425 | .dll;.bpl 426 | 427 | 428 | 429 | 430 | 1 431 | .dylib 432 | 433 | 434 | 1 435 | .dylib 436 | 437 | 438 | 1 439 | .dylib 440 | 441 | 442 | Contents\MacOS 443 | 1 444 | .dylib 445 | 446 | 447 | Contents\MacOS 448 | 1 449 | .dylib 450 | 451 | 452 | 0 453 | .bpl 454 | 455 | 456 | 457 | 458 | 0 459 | 460 | 461 | 0 462 | 463 | 464 | 0 465 | 466 | 467 | 0 468 | 469 | 470 | Contents\Resources\StartUp\ 471 | 0 472 | 473 | 474 | Contents\Resources\StartUp\ 475 | 0 476 | 477 | 478 | 0 479 | 480 | 481 | 482 | 483 | 1 484 | 485 | 486 | 1 487 | 488 | 489 | 1 490 | 491 | 492 | 493 | 494 | 1 495 | 496 | 497 | 1 498 | 499 | 500 | 1 501 | 502 | 503 | 504 | 505 | 1 506 | 507 | 508 | 1 509 | 510 | 511 | 1 512 | 513 | 514 | 515 | 516 | 1 517 | 518 | 519 | 1 520 | 521 | 522 | 1 523 | 524 | 525 | 526 | 527 | 1 528 | 529 | 530 | 1 531 | 532 | 533 | 1 534 | 535 | 536 | 537 | 538 | 1 539 | 540 | 541 | 1 542 | 543 | 544 | 1 545 | 546 | 547 | 548 | 549 | 1 550 | 551 | 552 | 1 553 | 554 | 555 | 1 556 | 557 | 558 | 559 | 560 | 1 561 | 562 | 563 | 1 564 | 565 | 566 | 1 567 | 568 | 569 | 570 | 571 | 1 572 | 573 | 574 | 1 575 | 576 | 577 | 1 578 | 579 | 580 | 581 | 582 | 1 583 | 584 | 585 | 1 586 | 587 | 588 | 1 589 | 590 | 591 | 592 | 593 | 1 594 | 595 | 596 | 1 597 | 598 | 599 | 1 600 | 601 | 602 | 603 | 604 | 1 605 | 606 | 607 | 1 608 | 609 | 610 | 1 611 | 612 | 613 | 614 | 615 | 1 616 | 617 | 618 | 1 619 | 620 | 621 | 1 622 | 623 | 624 | 625 | 626 | 1 627 | 628 | 629 | 1 630 | 631 | 632 | 1 633 | 634 | 635 | 636 | 637 | 1 638 | 639 | 640 | 1 641 | 642 | 643 | 1 644 | 645 | 646 | 647 | 648 | 1 649 | 650 | 651 | 1 652 | 653 | 654 | 1 655 | 656 | 657 | 658 | 659 | 1 660 | 661 | 662 | 1 663 | 664 | 665 | 1 666 | 667 | 668 | 669 | 670 | 1 671 | 672 | 673 | 1 674 | 675 | 676 | 1 677 | 678 | 679 | 680 | 681 | 1 682 | 683 | 684 | 1 685 | 686 | 687 | 1 688 | 689 | 690 | 691 | 692 | 1 693 | 694 | 695 | 1 696 | 697 | 698 | 1 699 | 700 | 701 | 702 | 703 | 1 704 | 705 | 706 | 1 707 | 708 | 709 | 1 710 | 711 | 712 | 713 | 714 | 1 715 | 716 | 717 | 1 718 | 719 | 720 | 1 721 | 722 | 723 | 724 | 725 | 1 726 | 727 | 728 | 1 729 | 730 | 731 | 1 732 | 733 | 734 | 735 | 736 | 1 737 | 738 | 739 | 1 740 | 741 | 742 | 1 743 | 744 | 745 | 746 | 747 | 1 748 | 749 | 750 | 1 751 | 752 | 753 | 1 754 | 755 | 756 | 757 | 758 | 1 759 | 760 | 761 | 1 762 | 763 | 764 | 1 765 | 766 | 767 | 768 | 769 | 1 770 | 771 | 772 | 1 773 | 774 | 775 | 1 776 | 777 | 778 | 779 | 780 | 1 781 | 782 | 783 | 1 784 | 785 | 786 | 1 787 | 788 | 789 | 790 | 791 | 1 792 | 793 | 794 | 795 | 796 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 797 | 1 798 | 799 | 800 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 801 | 1 802 | 803 | 804 | 805 | 806 | 1 807 | 808 | 809 | 1 810 | 811 | 812 | 813 | 814 | ..\ 815 | 1 816 | 817 | 818 | ..\ 819 | 1 820 | 821 | 822 | 823 | 824 | 1 825 | 826 | 827 | 1 828 | 829 | 830 | 1 831 | 832 | 833 | 834 | 835 | 1 836 | 837 | 838 | 1 839 | 840 | 841 | 1 842 | 843 | 844 | 845 | 846 | ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF 847 | 1 848 | 849 | 850 | 851 | 852 | ..\ 853 | 1 854 | 855 | 856 | ..\ 857 | 1 858 | 859 | 860 | 861 | 862 | Contents 863 | 1 864 | 865 | 866 | Contents 867 | 1 868 | 869 | 870 | 871 | 872 | Contents\Resources 873 | 1 874 | 875 | 876 | Contents\Resources 877 | 1 878 | 879 | 880 | 881 | 882 | library\lib\armeabi-v7a 883 | 1 884 | 885 | 886 | 1 887 | 888 | 889 | 1 890 | 891 | 892 | 1 893 | 894 | 895 | 1 896 | 897 | 898 | Contents\MacOS 899 | 1 900 | 901 | 902 | Contents\MacOS 903 | 1 904 | 905 | 906 | 0 907 | 908 | 909 | 910 | 911 | 1 912 | 913 | 914 | 1 915 | 916 | 917 | 918 | 919 | Assets 920 | 1 921 | 922 | 923 | Assets 924 | 1 925 | 926 | 927 | 928 | 929 | Assets 930 | 1 931 | 932 | 933 | Assets 934 | 1 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | False 949 | False 950 | False 951 | False 952 | False 953 | True 954 | False 955 | 956 | 957 | 12 958 | 959 | 960 | 961 | 962 | 963 | -------------------------------------------------------------------------------- /samples/delphi/SQLite/DAOSQLite.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/samples/delphi/SQLite/DAOSQLite.res -------------------------------------------------------------------------------- /samples/firemonkey/DAOSQLite.deployproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 12 5 | 6 | 7 | 8 | 9 | 10 | iPhone5 11 | 12 | 13 | 14 | 15 | 16 | 17 | DAOSQLite\ 18 | DAOSQLite.exe 19 | ProjectOutput 20 | 0 21 | 22 | 23 | True 24 | True 25 | 26 | 27 | 28 | 29 | DAOSQLite.app\Contents\MacOS\ 30 | DAOSQLite.rsm 31 | DebugSymbols 32 | 1 33 | 34 | 35 | True 36 | 37 | 38 | DAOSQLite.app\Contents\MacOS\ 39 | DAOSQLite 40 | ProjectOutput 41 | 1 42 | 43 | 44 | True 45 | True 46 | 47 | 48 | DAOSQLite.app\Contents\MacOS\ 49 | libcgsqlite3.dylib 50 | DependencyModule 51 | 1 52 | 53 | 54 | True 55 | 56 | 57 | DAOSQLite.app\Contents\MacOS\ 58 | libcgunwind.1.0.dylib 59 | DependencyModule 60 | 1 61 | 62 | 63 | True 64 | 65 | 66 | DAOSQLite.app\Contents\ 67 | Info.plist 68 | ProjectOSXInfoPList 69 | 1 70 | 71 | 72 | True 73 | 74 | 75 | DAOSQLite.app\Contents\Resources\ 76 | DAOSQLite.icns 77 | ProjectOSXResource 78 | 1 79 | 80 | 81 | True 82 | 83 | 84 | DAOSQLite.app\..\ 85 | DAOSQLite.entitlements 86 | ProjectOSXEntitlements 87 | 1 88 | 89 | 90 | True 91 | 92 | 93 | 94 | 95 | DAOSQLite\res\drawable-ldpi\ 96 | ic_launcher.png 97 | Android_LauncherIcon36 98 | 1 99 | 100 | 101 | True 102 | 103 | 104 | DAOSQLite\res\drawable-ldpi\ 105 | ic_launcher.png 106 | Android_LauncherIcon36 107 | 1 108 | 109 | 110 | True 111 | 112 | 113 | DAOSQLite\res\values\ 114 | styles.xml 115 | AndroidSplashStyles 116 | 1 117 | 118 | 119 | True 120 | 121 | 122 | DAOSQLite\res\drawable\ 123 | splash_image_def.xml 124 | AndroidSplashImageDef 125 | 1 126 | 127 | 128 | True 129 | 130 | 131 | DAOSQLite\res\drawable-small\ 132 | splash_image.png 133 | Android_SplashImage426 134 | 1 135 | 136 | 137 | True 138 | 139 | 140 | DAOSQLite\res\drawable-xlarge\ 141 | splash_image.png 142 | Android_SplashImage960 143 | 1 144 | 145 | 146 | True 147 | 148 | 149 | DAOSQLite\res\drawable-hdpi\ 150 | ic_launcher.png 151 | Android_LauncherIcon72 152 | 1 153 | 154 | 155 | True 156 | 157 | 158 | DAOSQLite\res\drawable-large\ 159 | splash_image.png 160 | Android_SplashImage640 161 | 1 162 | 163 | 164 | True 165 | 166 | 167 | DAOSQLite\library\lib\armeabi\ 168 | libDAOSQLite.so 169 | AndroidLibnativeArmeabiFile 170 | 1 171 | 172 | 173 | True 174 | 175 | 176 | DAOSQLite\res\drawable-xlarge\ 177 | splash_image.png 178 | Android_SplashImage960 179 | 1 180 | 181 | 182 | True 183 | 184 | 185 | DAOSQLite\res\drawable-hdpi\ 186 | ic_launcher.png 187 | Android_LauncherIcon72 188 | 1 189 | 190 | 191 | True 192 | 193 | 194 | DAOSQLite\res\drawable-small\ 195 | splash_image.png 196 | Android_SplashImage426 197 | 1 198 | 199 | 200 | True 201 | 202 | 203 | DAOSQLite\res\drawable-mdpi\ 204 | ic_launcher.png 205 | Android_LauncherIcon48 206 | 1 207 | 208 | 209 | True 210 | 211 | 212 | DAOSQLite\library\lib\armeabi-v7a\ 213 | gdbserver 214 | AndroidGDBServer 215 | 1 216 | 217 | 218 | True 219 | 220 | 221 | DAOSQLite\library\lib\mips\ 222 | libDAOSQLite.so 223 | AndroidLibnativeMipsFile 224 | 1 225 | 226 | 227 | True 228 | 229 | 230 | DAOSQLite\classes\ 231 | classes.dex 232 | AndroidClassesDexFile 233 | 1 234 | 235 | 236 | True 237 | 238 | 239 | DAOSQLite\library\lib\armeabi-v7a\ 240 | gdbserver 241 | AndroidGDBServer 242 | 1 243 | 244 | 245 | True 246 | 247 | 248 | DAOSQLite\res\drawable\ 249 | splash_image_def.xml 250 | AndroidSplashImageDef 251 | 1 252 | 253 | 254 | True 255 | 256 | 257 | DAOSQLite\res\values\ 258 | styles.xml 259 | AndroidSplashStyles 260 | 1 261 | 262 | 263 | True 264 | 265 | 266 | DAOSQLite\res\drawable-xxhdpi\ 267 | ic_launcher.png 268 | Android_LauncherIcon144 269 | 1 270 | 271 | 272 | True 273 | 274 | 275 | DAOSQLite\ 276 | AndroidManifest.xml 277 | ProjectAndroidManifest 278 | 1 279 | 280 | 281 | True 282 | 283 | 284 | DAOSQLite\library\lib\armeabi\ 285 | libDAOSQLite.so 286 | AndroidLibnativeArmeabiFile 287 | 1 288 | 289 | 290 | True 291 | 292 | 293 | DAOSQLite\res\drawable-xxhdpi\ 294 | ic_launcher.png 295 | Android_LauncherIcon144 296 | 1 297 | 298 | 299 | True 300 | 301 | 302 | DAOSQLite\res\drawable-normal\ 303 | splash_image.png 304 | Android_SplashImage470 305 | 1 306 | 307 | 308 | True 309 | 310 | 311 | DAOSQLite\library\lib\armeabi-v7a\ 312 | libDAOSQLite.so 313 | ProjectOutput 314 | 1 315 | 316 | 317 | True 318 | True 319 | 320 | 321 | DAOSQLite\library\lib\mips\ 322 | libDAOSQLite.so 323 | AndroidLibnativeMipsFile 324 | 1 325 | 326 | 327 | True 328 | 329 | 330 | DAOSQLite\res\drawable-xhdpi\ 331 | ic_launcher.png 332 | Android_LauncherIcon96 333 | 1 334 | 335 | 336 | True 337 | 338 | 339 | DAOSQLite\res\drawable-normal\ 340 | splash_image.png 341 | Android_SplashImage470 342 | 1 343 | 344 | 345 | True 346 | 347 | 348 | DAOSQLite\res\drawable-xhdpi\ 349 | ic_launcher.png 350 | Android_LauncherIcon96 351 | 1 352 | 353 | 354 | True 355 | 356 | 357 | DAOSQLite\res\drawable-large\ 358 | splash_image.png 359 | Android_SplashImage640 360 | 1 361 | 362 | 363 | True 364 | 365 | 366 | DAOSQLite\library\lib\armeabi-v7a\ 367 | libDAOSQLite.so 368 | ProjectOutput 369 | 1 370 | 371 | 372 | True 373 | True 374 | 375 | 376 | DAOSQLite\ 377 | AndroidManifest.xml 378 | ProjectAndroidManifest 379 | 1 380 | 381 | 382 | True 383 | 384 | 385 | DAOSQLite\classes\ 386 | classes.dex 387 | AndroidClassesDexFile 388 | 1 389 | 390 | 391 | True 392 | 393 | 394 | DAOSQLite\res\drawable-mdpi\ 395 | ic_launcher.png 396 | Android_LauncherIcon48 397 | 1 398 | 399 | 400 | True 401 | 402 | 403 | 404 | 405 | DAOSQLite.app\ 406 | libPCRE.dylib 407 | DependencyModule 408 | 1 409 | 410 | 411 | True 412 | 413 | 414 | DAOSQLite.app\ 415 | libcgunwind.1.0.dylib 416 | DependencyModule 417 | 1 418 | 419 | 420 | True 421 | 422 | 423 | DAOSQLite.app\ 424 | libpcre.dylib 425 | DependencyModule 426 | 1 427 | 428 | 429 | True 430 | 431 | 432 | 433 | -------------------------------------------------------------------------------- /samples/firemonkey/DAOSQLite.dpr: -------------------------------------------------------------------------------- 1 | program DAOSQLite; 2 | 3 | uses 4 | System.StartUpCopy, 5 | FMX.Forms, 6 | Main in 'Main.pas' {Form1}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.CreateForm(TForm1, Form1); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /samples/firemonkey/DAOSQLite.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exilon/QuickDAO/7226b0324b5f74f5647b1aff241289ff1e6cb539/samples/firemonkey/DAOSQLite.res -------------------------------------------------------------------------------- /samples/firemonkey/Main.fmx: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form1' 5 | ClientHeight = 480 6 | ClientWidth = 640 7 | FormFactor.Width = 320 8 | FormFactor.Height = 480 9 | FormFactor.Devices = [Desktop] 10 | DesignerMasterStyle = 0 11 | object Memo1: TMemo 12 | Touch.InteractiveGestures = [Pan, LongTap, DoubleTap] 13 | DataDetectorTypes = [] 14 | ReadOnly = True 15 | ShowSizeGrip = True 16 | StyledSettings = [Family, Style, FontColor] 17 | TextSettings.Font.Size = 11.000000000000000000 18 | Align = MostTop 19 | Anchors = [akLeft, akTop, akRight, akBottom] 20 | Size.Width = 640.000000000000000000 21 | Size.Height = 441.000000000000000000 22 | Size.PlatformDefault = False 23 | TabOrder = 0 24 | Viewport.Width = 636.000000000000000000 25 | Viewport.Height = 437.000000000000000000 26 | end 27 | object Panel1: TPanel 28 | Align = MostBottom 29 | Position.Y = 440.000000000000000000 30 | Size.Width = 640.000000000000000000 31 | Size.Height = 40.000000000000000000 32 | Size.PlatformDefault = False 33 | TabOrder = 2 34 | object btnProcess: TButton 35 | Align = Client 36 | Anchors = [akLeft, akRight, akBottom] 37 | Size.Width = 640.000000000000000000 38 | Size.Height = 40.000000000000000000 39 | Size.PlatformDefault = False 40 | TabOrder = 1 41 | Text = 'Start' 42 | OnClick = btnProcessClick 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /samples/firemonkey/Main.pas: -------------------------------------------------------------------------------- 1 | unit Main; 2 | 3 | interface 4 | 5 | uses 6 | System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 7 | FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, 8 | System.IOUtils, 9 | FMX.StdCtrls, FMX.Controls.Presentation, 10 | FMX.ScrollBox, FMX.Memo, 11 | Quick.Commons, 12 | Quick.Chrono, 13 | Quick.DAO, 14 | Quick.DAO.Engine.FireDAC; 15 | 16 | type 17 | TForm1 = class(TForm) 18 | Memo1: TMemo; 19 | Panel1: TPanel; 20 | btnProcess: TButton; 21 | procedure btnProcessClick(Sender: TObject); 22 | private 23 | { Private declarations } 24 | public 25 | { Public declarations } 26 | end; 27 | 28 | TGenre = (gMale, gFemale); 29 | 30 | TConnection = class 31 | private 32 | fIdConnection : Integer; 33 | fConnectionDate : TDateTime; 34 | published 35 | property IdConnection : Integer read fIdConnection write fIdConnection; 36 | property ConnectionDate : TDateTime read fConnectionDate write fConnectionDate; 37 | end; 38 | 39 | TConnections = array of TConnection; 40 | 41 | TGroups = array of Int64; 42 | 43 | TLocation = record 44 | Street : string; 45 | Number : Integer; 46 | City : string; 47 | end; 48 | 49 | TUser = class(TDAORecord) 50 | private 51 | fIdUser : TAutoID; 52 | fName : string; 53 | fSurname : string; 54 | fAge : Integer; 55 | fActive : Boolean; 56 | fGenre : TGenre; 57 | fMoney : Double; 58 | fLastInfo : TDateTime; 59 | fGroups : TGroups; 60 | fLocation : TLocation; 61 | //fConnections : TConnections; 62 | published 63 | property IdUser : TAutoID read fIdUser write fIdUser; 64 | //[TFieldVARCHAR(50)] 65 | property Name : string index 50 read fName write fName; 66 | [TFieldVARCHAR(255)] 67 | property Surname : string read fSurname write fSurname; 68 | //[TMapField('UserAge')] 69 | property Age : Integer read fAge write fAge; 70 | property Active : Boolean read fActive write fActive; 71 | property Genre : TGenre read fGenre write fGenre; 72 | //[TFieldDECIMAL(10,2)] 73 | property Money : Double index 2 read fMoney write fMoney; 74 | property LastInfo : TDateTime read fLastInfo write fLastInfo; 75 | property Groups : TGroups read fGroups write fGroups; 76 | property Location : TLocation read fLocation write fLocation; 77 | //property Connections : TConnections read fConnections write fConnections; 78 | end; 79 | 80 | const 81 | UserNames : array of string = ['Cliff','Alan','Anna','Phil','John','Michel','Jennifer','Peter','Brandon','Joe','Steve','Lorraine','Bill','Tom']; 82 | UserSurnames : array of string = ['Gordon','Summer','Huan','Paterson','Johnson','Michelson','Smith','Peterson','Miller','McCarney','Roller','Gonzalez','Thomson','Muller']; 83 | 84 | var 85 | DAODatabase : TDAODataBaseFireDAC; 86 | User : TUser; 87 | NumUsers : Integer; 88 | i : Integer; 89 | crono : TChronometer; 90 | 91 | var 92 | Form1: TForm1; 93 | 94 | implementation 95 | 96 | {$R *.fmx} 97 | 98 | procedure TForm1.btnProcessClick(Sender: TObject); 99 | var 100 | connection : TConnection; 101 | location : TLocation; 102 | iresult : IDAOResult; 103 | begin 104 | crono := TChronometer.Create(False); 105 | DAODatabase := TDAODataBaseFireDAC.Create; 106 | DAODatabase.Connection.Provider := TDBProvider.daoSQLite; 107 | {$IFNDEF NEXTGEN} 108 | DAODatabase.Connection.Database := '.\test.db3'; 109 | {$ELSE} 110 | DAODatabase.Connection.Database := TPath.GetDocumentsPath + PathDelim + 'test.db3'; 111 | {$ENDIF} 112 | DAODatabase.Models.Add(TUser,'IdUser'); 113 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 114 | if DAODatabase.Connect then Memo1.Lines.Add('Connected to database') 115 | else Memo1.Lines.Add('Can''t connect to database'); 116 | 117 | NumUsers := 100; 118 | 119 | Memo1.Lines.Add(Format('Adding %d users to db...',[NumUsers])); 120 | crono.Start; 121 | //create random records 122 | User := TUser.Create; 123 | try 124 | for i := 1 to NumUsers do 125 | begin 126 | //User.IdUser := Random(999999999999999); 127 | User.Name := UserNames[Random(High(UserNames))]; 128 | User.Surname := UserSurnames[Random(High(UserSurnames))] + ' ' + UserSurnames[Random(High(UserSurnames))];; 129 | User.Age := Random(30)+18; 130 | User.Genre := TGenre(Random(1)); 131 | User.LastInfo := Now(); 132 | User.Money := Random(50000); 133 | User.Active := True; 134 | User.Groups := [1,2,3,4,5,6,7]; 135 | location.Street := 'Main St'; 136 | location.Number := 1; 137 | location.City := 'London'; 138 | User.Location := location; 139 | DAODatabase.Add(User); 140 | end; 141 | finally 142 | User.Free; 143 | end; 144 | crono.Stop; 145 | Memo1.Lines.Add(Format('Elapsed %s to insert %d records (Total in DB = %s)',[crono.ElapsedTime,NumUsers,NumberToStr(DAODatabase.From.Count)])); 146 | 147 | //get users 148 | Memo1.Lines.Add('Where query...'); 149 | iresult := DAODatabase.From.Where('Age > ? AND Age < ?',[30,35]).OrderBy('Name').SelectTop(10); 150 | for User in iresult do 151 | begin 152 | Memo1.Lines.Add(Format('IdUser: %d Name: %s %s Age: %d Genre: %d LastInfo: %s',[User.IdUser,User.Name,User.Surname,User.Age,Ord(User.Genre),DateTimetoStr(User.LastInfo)])); 153 | User.Free; 154 | end; 155 | Memo1.Lines.Add(Format('Query results: %s',[NumberToStr(iresult.Count)])); 156 | 157 | //modify user 158 | Memo1.Lines.Add('Modify a existing User...'); 159 | User := DAODatabase.From.Where('IdUser = ?',[1]).SelectFirst; 160 | try 161 | if User <> nil then 162 | begin 163 | Memo1.Lines.Add(Format('Found -> IdUser: %d Name: %s %s Age: %d',[User.IdUser,User.Name,User.Surname,User.Age])); 164 | User.Age := 30; 165 | User.Active := True; 166 | DAODatabase.Update(User); 167 | end 168 | else Memo1.Lines.Add('Can''t found this User'); 169 | finally 170 | User.Free; 171 | end; 172 | 173 | Memo1.Lines.Add('Count total Users...'); 174 | Memo1.Lines.Add(Format('Num users in DB: %s',[NumberToStr(DAODatabase.From.Count)])); 175 | 176 | Memo1.Lines.Add('< Finished >'); 177 | DAODatabase.Free; 178 | crono.Free; 179 | end; 180 | 181 | end. 182 | -------------------------------------------------------------------------------- /samples/fpc/SQLite/DAOSQLite.lpi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <UseAppBundle Value="False"/> 16 | <ResourceType Value="res"/> 17 | </General> 18 | <BuildModes Count="1"> 19 | <Item1 Name="Default" Default="True"/> 20 | </BuildModes> 21 | <PublishOptions> 22 | <Version Value="2"/> 23 | </PublishOptions> 24 | <RunParams> 25 | <FormatVersion Value="2"/> 26 | <Modes Count="0"/> 27 | </RunParams> 28 | <Units Count="1"> 29 | <Unit0> 30 | <Filename Value="DAOSQLite.pas"/> 31 | <IsPartOfProject Value="True"/> 32 | </Unit0> 33 | </Units> 34 | </ProjectOptions> 35 | <CompilerOptions> 36 | <Version Value="11"/> 37 | <PathDelim Value="\"/> 38 | <Target> 39 | <Filename Value="bin\DAOSQLite"/> 40 | </Target> 41 | <SearchPaths> 42 | <IncludeFiles Value="$(ProjOutDir)"/> 43 | <OtherUnitFiles Value="..\..\..;..\..\..\..\QuickLib;..\..\..\..\..\SQLite3\Source"/> 44 | <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 45 | </SearchPaths> 46 | </CompilerOptions> 47 | <Debugging> 48 | <Exceptions Count="3"> 49 | <Item1> 50 | <Name Value="EAbort"/> 51 | </Item1> 52 | <Item2> 53 | <Name Value="ECodetoolError"/> 54 | </Item2> 55 | <Item3> 56 | <Name Value="EFOpenError"/> 57 | </Item3> 58 | </Exceptions> 59 | </Debugging> 60 | </CONFIG> 61 | -------------------------------------------------------------------------------- /samples/fpc/SQLite/DAOSQLite.lps: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <PathDelim Value="\"/> 5 | <Version Value="11"/> 6 | <BuildModes Active="Default"/> 7 | <Units Count="12"> 8 | <Unit0> 9 | <Filename Value="DAOSQLite.pas"/> 10 | <IsPartOfProject Value="True"/> 11 | <IsVisibleTab Value="True"/> 12 | <EditorIndex Value="1"/> 13 | <TopLine Value="56"/> 14 | <CursorPos Y="77"/> 15 | <UsageCount Value="160"/> 16 | <Loaded Value="True"/> 17 | </Unit0> 18 | <Unit1> 19 | <Filename Value="..\..\..\Quick.DAO.pas"/> 20 | <EditorIndex Value="2"/> 21 | <TopLine Value="26"/> 22 | <CursorPos X="31" Y="194"/> 23 | <UsageCount Value="15"/> 24 | <Loaded Value="True"/> 25 | </Unit1> 26 | <Unit2> 27 | <Filename Value="D:\Lazarus\fpcsrc\packages\rtl-objpas\src\inc\rtti.pp"/> 28 | <UnitName Value="Rtti"/> 29 | <EditorIndex Value="-1"/> 30 | <TopLine Value="249"/> 31 | <CursorPos X="14" Y="269"/> 32 | <UsageCount Value="2"/> 33 | </Unit2> 34 | <Unit3> 35 | <Filename Value="D:\Lazarus\fpcsrc\packages\rtl-generics\src\generics.collections.pas"/> 36 | <UnitName Value="Generics.Collections"/> 37 | <EditorIndex Value="-1"/> 38 | <TopLine Value="116"/> 39 | <CursorPos X="3" Y="137"/> 40 | <UsageCount Value="13"/> 41 | </Unit3> 42 | <Unit4> 43 | <Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\typinfo.pp"/> 44 | <UnitName Value="TypInfo"/> 45 | <EditorIndex Value="-1"/> 46 | <TopLine Value="35"/> 47 | <CursorPos X="8" Y="51"/> 48 | <UsageCount Value="14"/> 49 | </Unit4> 50 | <Unit5> 51 | <Filename Value="..\..\..\Quick.DAO.Engine.SQLite3.pas"/> 52 | <EditorIndex Value="3"/> 53 | <TopLine Value="22"/> 54 | <CursorPos X="24" Y="250"/> 55 | <UsageCount Value="80"/> 56 | <Loaded Value="True"/> 57 | </Unit5> 58 | <Unit6> 59 | <Filename Value="..\..\..\Quick.DAO.Database.pas"/> 60 | <EditorIndex Value="-1"/> 61 | <TopLine Value="190"/> 62 | <CursorPos X="56" Y="191"/> 63 | <UsageCount Value="14"/> 64 | </Unit6> 65 | <Unit7> 66 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 67 | <TopLine Value="357"/> 68 | <CursorPos X="40" Y="337"/> 69 | <UsageCount Value="79"/> 70 | <Loaded Value="True"/> 71 | </Unit7> 72 | <Unit8> 73 | <Filename Value="..\..\..\..\..\SQLite3\Source\SQLite3Wrap.pas"/> 74 | <EditorIndex Value="-1"/> 75 | <TopLine Value="152"/> 76 | <CursorPos Y="173"/> 77 | <UsageCount Value="11"/> 78 | </Unit8> 79 | <Unit9> 80 | <Filename Value="D:\Lazarus\fpcsrc\rtl\inc\rttih.inc"/> 81 | <EditorIndex Value="-1"/> 82 | <TopLine Value="3"/> 83 | <CursorPos X="3" Y="36"/> 84 | <UsageCount Value="2"/> 85 | </Unit9> 86 | <Unit10> 87 | <Filename Value="..\..\..\Quick.DAO.QueryGenerator.SQLite.pas"/> 88 | <EditorIndex Value="-1"/> 89 | <TopLine Value="111"/> 90 | <CursorPos X="72" Y="112"/> 91 | <UsageCount Value="1"/> 92 | </Unit10> 93 | <Unit11> 94 | <Filename Value="..\..\..\..\QuickLib\Quick.Rtti.fpc.Compatibility.pas"/> 95 | <EditorIndex Value="-1"/> 96 | <TopLine Value="21"/> 97 | <CursorPos X="48" Y="57"/> 98 | <UsageCount Value="10"/> 99 | </Unit11> 100 | </Units> 101 | <JumpHistory Count="30" HistoryIndex="29"> 102 | <Position1> 103 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 104 | <Caret Line="96" Column="42" TopLine="63"/> 105 | </Position1> 106 | <Position2> 107 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 108 | <Caret Line="98" Column="49" TopLine="65"/> 109 | </Position2> 110 | <Position3> 111 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 112 | <Caret Line="102" Column="47" TopLine="69"/> 113 | </Position3> 114 | <Position4> 115 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 116 | <Caret Line="104" Column="43" TopLine="71"/> 117 | </Position4> 118 | <Position5> 119 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 120 | <Caret Line="106" Column="47" TopLine="73"/> 121 | </Position5> 122 | <Position6> 123 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 124 | <Caret Line="108" Column="49" TopLine="75"/> 125 | </Position6> 126 | <Position7> 127 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 128 | <Caret Line="109" Column="59" TopLine="76"/> 129 | </Position7> 130 | <Position8> 131 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 132 | <Caret Line="135" Column="24" TopLine="101"/> 133 | </Position8> 134 | <Position9> 135 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 136 | <Caret Line="185" Column="87" TopLine="151"/> 137 | </Position9> 138 | <Position10> 139 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 140 | <Caret Line="263" Column="70" TopLine="229"/> 141 | </Position10> 142 | <Position11> 143 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 144 | <Caret Line="271" Column="24" TopLine="237"/> 145 | </Position11> 146 | <Position12> 147 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 148 | <Caret Line="273" Column="17" TopLine="239"/> 149 | </Position12> 150 | <Position13> 151 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 152 | <Caret Line="308" Column="104" TopLine="274"/> 153 | </Position13> 154 | <Position14> 155 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 156 | <Caret Line="310" Column="21" TopLine="276"/> 157 | </Position14> 158 | <Position15> 159 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 160 | <Caret Line="314" Column="10" TopLine="277"/> 161 | </Position15> 162 | <Position16> 163 | <Filename Value="..\..\..\Quick.DAO.Engine.SQLite3.pas"/> 164 | <Caret Line="238" TopLine="204"/> 165 | </Position16> 166 | <Position17> 167 | <Filename Value="DAOSQLite.pas"/> 168 | <Caret Line="82" Column="40" TopLine="61"/> 169 | </Position17> 170 | <Position18> 171 | <Filename Value="DAOSQLite.pas"/> 172 | <Caret Line="78" Column="64" TopLine="55"/> 173 | </Position18> 174 | <Position19> 175 | <Filename Value="DAOSQLite.pas"/> 176 | <Caret Line="82" Column="51" TopLine="61"/> 177 | </Position19> 178 | <Position20> 179 | <Filename Value="..\..\..\Quick.DAO.pas"/> 180 | <Caret Line="106" Column="26" TopLine="73"/> 181 | </Position20> 182 | <Position21> 183 | <Filename Value="DAOSQLite.pas"/> 184 | <Caret Line="82" Column="62" TopLine="61"/> 185 | </Position21> 186 | <Position22> 187 | <Filename Value="..\..\..\Quick.DAO.pas"/> 188 | <Caret Line="105" Column="64" TopLine="94"/> 189 | </Position22> 190 | <Position23> 191 | <Filename Value="..\..\..\Quick.DAO.pas"/> 192 | <Caret Line="194" Column="31" TopLine="160"/> 193 | </Position23> 194 | <Position24> 195 | <Filename Value="..\..\..\Quick.DAO.pas"/> 196 | <Caret Line="658" Column="29" TopLine="624"/> 197 | </Position24> 198 | <Position25> 199 | <Filename Value="..\..\..\Quick.DAO.pas"/> 200 | <Caret Line="700" Column="29" TopLine="666"/> 201 | </Position25> 202 | <Position26> 203 | <Filename Value="..\..\..\Quick.DAO.Engine.SQLite3.pas"/> 204 | <Caret Line="208" Column="55" TopLine="204"/> 205 | </Position26> 206 | <Position27> 207 | <Filename Value="..\..\..\Quick.DAO.Engine.SQLite3.pas"/> 208 | <Caret Line="250" Column="24" TopLine="22"/> 209 | </Position27> 210 | <Position28> 211 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 212 | <Caret Line="10" Column="59"/> 213 | </Position28> 214 | <Position29> 215 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 216 | <Caret Line="78" Column="31" TopLine="44"/> 217 | </Position29> 218 | <Position30> 219 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 220 | <Caret Line="337" Column="40" TopLine="357"/> 221 | </Position30> 222 | </JumpHistory> 223 | <RunParams> 224 | <FormatVersion Value="2"/> 225 | <Modes Count="0" ActiveMode=""/> 226 | </RunParams> 227 | </ProjectSession> 228 | <Debugging> 229 | <BreakPoints Count="5"> 230 | <Item1> 231 | <Kind Value="bpkSource"/> 232 | <WatchScope Value="wpsLocal"/> 233 | <WatchKind Value="wpkWrite"/> 234 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 235 | <Line Value="220"/> 236 | </Item1> 237 | <Item2> 238 | <Kind Value="bpkSource"/> 239 | <WatchScope Value="wpsLocal"/> 240 | <WatchKind Value="wpkWrite"/> 241 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 242 | <Line Value="236"/> 243 | </Item2> 244 | <Item3> 245 | <Kind Value="bpkSource"/> 246 | <WatchScope Value="wpsLocal"/> 247 | <WatchKind Value="wpkWrite"/> 248 | <Source Value="..\MSSQL\DAOMSSQL.lpr"/> 249 | <Line Value="112"/> 250 | </Item3> 251 | <Item4> 252 | <Kind Value="bpkSource"/> 253 | <WatchScope Value="wpsLocal"/> 254 | <WatchKind Value="wpkWrite"/> 255 | <Source Value="D:\Lazarus\fpcsrc\packages\rtl-objpas\src\inc\rtti.pp"/> 256 | <Line Value="2435"/> 257 | </Item4> 258 | <Item5> 259 | <Kind Value="bpkSource"/> 260 | <WatchScope Value="wpsLocal"/> 261 | <WatchKind Value="wpkWrite"/> 262 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 263 | <Line Value="407"/> 264 | </Item5> 265 | </BreakPoints> 266 | <Watches Count="2"> 267 | <Item1> 268 | <Expression Value="propertyname"/> 269 | </Item1> 270 | <Item2> 271 | <Expression Value="aFieldName"/> 272 | </Item2> 273 | </Watches> 274 | </Debugging> 275 | </CONFIG> 276 | -------------------------------------------------------------------------------- /samples/fpc/SQLite/DAOSQLite.pas: -------------------------------------------------------------------------------- 1 | program DAOSQLite; 2 | 3 | {$mode delphi} 4 | 5 | uses 6 | SysUtils, 7 | Quick.Commons, 8 | Quick.Console, 9 | Quick.Chrono, 10 | Quick.DAO, 11 | Quick.DAO.Engine.SQLite3; 12 | type 13 | TGenre = (gMale, gFemale); 14 | 15 | TConnection = class 16 | private 17 | fIdConnection : Integer; 18 | fConnectionDate : TDateTime; 19 | published 20 | property IdConnection : Integer read fIdConnection write fIdConnection; 21 | property ConnectionDate : TDateTime read fConnectionDate write fConnectionDate; 22 | end; 23 | 24 | TConnections = array of TConnection; 25 | 26 | TGroups = array of Int64; 27 | 28 | TLocation = record 29 | Street : string; 30 | Number : Integer; 31 | City : string; 32 | end; 33 | 34 | TUser = class(TDAORecord) 35 | private 36 | fIdUser : TAutoID; 37 | fName : string; 38 | fSurname : string; 39 | fAge : Integer; 40 | fActive : Boolean; 41 | fGenre : TGenre; 42 | fMoney : Double; 43 | fLastInfo : TDateTime; 44 | fGroups : TGroups; 45 | //fLocation : TLocation; 46 | //fConnections : TConnections; 47 | published 48 | property IdUser : TAutoID read fIdUser write fIdUser; 49 | //[TFieldVARCHAR(50)] 50 | property Name : string index 50 read fName write fName; 51 | //[TFieldVARCHAR(255)] 52 | property Surname : string read fSurname write fSurname; 53 | //[TMapField('UserAge')] 54 | property Age : Integer read fAge write fAge; 55 | property Active : Boolean read fActive write fActive; 56 | property Genre : TGenre read fGenre write fGenre; 57 | //[TFieldDECIMAL(10,2)] 58 | property Money : Double index 2 read fMoney write fMoney; 59 | property LastInfo : TDateTime read fLastInfo write fLastInfo; 60 | property Groups : TGroups read fGroups write fGroups; 61 | //property Location : TLocation read fLocation write fLocation; 62 | //property Connections : TConnections read fConnections write fConnections; 63 | end; 64 | 65 | const 66 | UserNames : array[0..13] of string = ('Cliff','Alan','Anna','Phil','John','Michel','Jennifer','Peter','Brandon','Joe','Steve','Lorraine','Bill','Tom'); 67 | UserSurnames: array[0..13] of string = ('Gordon','Summer','Huan','Paterson','Johnson','Michelson','Smith','Peterson','Miller','McCarney','Roller','Gonzalez','Thomson','Muller'); 68 | 69 | var 70 | DAODatabase : TDAODataBaseSQLite3; 71 | User : TUser; 72 | iresult : IDAOResult<TUser>; 73 | NumUsers : Integer; 74 | i : Integer; 75 | crono : TChronometer; 76 | 77 | begin 78 | try 79 | crono := TChronometer.Create(False); 80 | 81 | DAODatabase := TDAODataBaseSQLite3.Create; 82 | DAODatabase.Connection.Provider := TDBProvider.daoSQLite; 83 | DAODatabase.Connection.Database := '.\test.db3'; 84 | DAODatabase.Models.Add(TUser,'IdUser'); 85 | DAODatabase.Indexes.Add(TUser,['Name'],orAscending); 86 | if DAODatabase.Connect then cout('Connected to database',etSuccess) 87 | else cout('Can''t connect to database',etError); 88 | 89 | NumUsers := 100; 90 | 91 | cout('Adding %d users to db...',[NumUsers],etInfo); 92 | crono.Start; 93 | //create random records 94 | User := TUser.Create; 95 | try 96 | for i := 1 to NumUsers do 97 | begin 98 | //User.IdUser := Random(999999999999999); 99 | User.Name := UserNames[Random(High(UserNames))]; 100 | User.Surname := UserSurnames[Random(High(UserSurnames))] + ' ' + UserSurnames[Random(High(UserSurnames))];; 101 | User.Age := Random(30)+18; 102 | User.Genre := TGenre(Random(1)); 103 | User.LastInfo := Now; 104 | User.Money := Random(50000); 105 | User.Active := True; 106 | User.Groups := [1,2,3,4,5,6,7]; 107 | DAODatabase.Add(User); 108 | end; 109 | finally 110 | User.Free; 111 | end; 112 | crono.Stop; 113 | coutFmt('Elapsed %s to insert %d records (Total in DB = %s)',[crono.ElapsedTime,NumUsers,NumberToStr(DAODatabase.From<TUser>.Count)],etSuccess); 114 | cout('< Press a key to continue to next test >',etTrace); 115 | Readln; 116 | 117 | //get users 118 | cout('Where query...',etInfo); 119 | //User := TUser.Create(DAODatabase,'IdUser > ?',[0]); 120 | //User := TUser.Create(DAODatabase,'Age > ? AND Age < ?',[30,35]); 121 | iresult := DAODatabase.From<TUser>.Where('Age > ? AND Age < ?',[30,35]).OrderBy('Name').SelectTop(10); 122 | for User in iresult do 123 | begin 124 | cout('IdUser: %d Name: %s %s Age: %d Genre: %d LastInfo: %s',[User.IdUser,User.Name,User.Surname,User.Age,Ord(User.Genre),DateTimetoStr(User.LastInfo)],etSuccess); 125 | User.Free; 126 | end; 127 | cout('Query results: %s',[NumberToStr(iresult.Count)],etInfo); 128 | 129 | cout('< Press a key to continue to next test >',etTrace); 130 | Readln; 131 | 132 | //modify user 133 | cout('Modify a existing User...',etInfo); 134 | User := DAODatabase.From<TUser>.Where('IdUser = ?',[1]).SelectFirst; 135 | try 136 | if User <> nil then 137 | begin 138 | cout('Found -> IdUser: %d Name: %s %s Age: %d',[User.IdUser,User.Name,User.Surname,User.Age],etInfo); 139 | User.Age := 30; 140 | User.Active := True; 141 | DAODatabase.Update(User); 142 | end 143 | else cout('Can''t found this User',etError); 144 | finally 145 | User.Free; 146 | end; 147 | 148 | cout('Count total Users...',etInfo); 149 | coutFmt('Num users in DB: %s',[NumberToStr(DAODatabase.From<TUser>.Count)],etInfo); 150 | 151 | cout('< Press a key to Exit >',etInfo); 152 | ConsoleWaitForEnterKey; 153 | DAODatabase.Free; 154 | crono.Free; 155 | except 156 | on E: Exception do 157 | Writeln(E.ClassName, ': ', E.Message); 158 | end; 159 | end. 160 | 161 | -------------------------------------------------------------------------------- /samples/fpc/SQLite/backup/DAOSQLite.lps: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" encoding="UTF-8"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <PathDelim Value="\"/> 5 | <Version Value="11"/> 6 | <BuildModes Active="Default"/> 7 | <Units Count="12"> 8 | <Unit0> 9 | <Filename Value="DAOSQLite.pas"/> 10 | <IsPartOfProject Value="True"/> 11 | <IsVisibleTab Value="True"/> 12 | <TopLine Value="56"/> 13 | <CursorPos Y="77"/> 14 | <UsageCount Value="160"/> 15 | <Loaded Value="True"/> 16 | </Unit0> 17 | <Unit1> 18 | <Filename Value="..\..\..\Quick.DAO.pas"/> 19 | <EditorIndex Value="-1"/> 20 | <TopLine Value="26"/> 21 | <CursorPos X="31" Y="194"/> 22 | <UsageCount Value="15"/> 23 | </Unit1> 24 | <Unit2> 25 | <Filename Value="D:\Lazarus\fpcsrc\packages\rtl-objpas\src\inc\rtti.pp"/> 26 | <UnitName Value="Rtti"/> 27 | <EditorIndex Value="-1"/> 28 | <TopLine Value="249"/> 29 | <CursorPos X="14" Y="269"/> 30 | <UsageCount Value="2"/> 31 | </Unit2> 32 | <Unit3> 33 | <Filename Value="D:\Lazarus\fpcsrc\packages\rtl-generics\src\generics.collections.pas"/> 34 | <UnitName Value="Generics.Collections"/> 35 | <EditorIndex Value="-1"/> 36 | <TopLine Value="116"/> 37 | <CursorPos X="3" Y="137"/> 38 | <UsageCount Value="13"/> 39 | </Unit3> 40 | <Unit4> 41 | <Filename Value="D:\Lazarus\fpcsrc\rtl\objpas\typinfo.pp"/> 42 | <UnitName Value="TypInfo"/> 43 | <EditorIndex Value="-1"/> 44 | <TopLine Value="35"/> 45 | <CursorPos X="8" Y="51"/> 46 | <UsageCount Value="14"/> 47 | </Unit4> 48 | <Unit5> 49 | <Filename Value="..\..\..\Quick.DAO.Engine.SQLite3.pas"/> 50 | <EditorIndex Value="-1"/> 51 | <TopLine Value="22"/> 52 | <CursorPos X="24" Y="250"/> 53 | <UsageCount Value="80"/> 54 | </Unit5> 55 | <Unit6> 56 | <Filename Value="..\..\..\Quick.DAO.Database.pas"/> 57 | <EditorIndex Value="-1"/> 58 | <TopLine Value="190"/> 59 | <CursorPos X="56" Y="191"/> 60 | <UsageCount Value="14"/> 61 | </Unit6> 62 | <Unit7> 63 | <Filename Value="..\..\..\Quick.DAO.Query.pas"/> 64 | <EditorIndex Value="-1"/> 65 | <TopLine Value="357"/> 66 | <CursorPos X="40" Y="337"/> 67 | <UsageCount Value="79"/> 68 | </Unit7> 69 | <Unit8> 70 | <Filename Value="..\..\..\..\..\SQLite3\Source\SQLite3Wrap.pas"/> 71 | <EditorIndex Value="-1"/> 72 | <TopLine Value="152"/> 73 | <CursorPos Y="173"/> 74 | <UsageCount Value="11"/> 75 | </Unit8> 76 | <Unit9> 77 | <Filename Value="D:\Lazarus\fpcsrc\rtl\inc\rttih.inc"/> 78 | <EditorIndex Value="-1"/> 79 | <TopLine Value="3"/> 80 | <CursorPos X="3" Y="36"/> 81 | <UsageCount Value="2"/> 82 | </Unit9> 83 | <Unit10> 84 | <Filename Value="..\..\..\Quick.DAO.QueryGenerator.SQLite.pas"/> 85 | <EditorIndex Value="-1"/> 86 | <TopLine Value="111"/> 87 | <CursorPos X="72" Y="112"/> 88 | <UsageCount Value="1"/> 89 | </Unit10> 90 | <Unit11> 91 | <Filename Value="..\..\..\..\QuickLib\Quick.Rtti.fpc.Compatibility.pas"/> 92 | <EditorIndex Value="-1"/> 93 | <TopLine Value="21"/> 94 | <CursorPos X="48" Y="57"/> 95 | <UsageCount Value="10"/> 96 | </Unit11> 97 | </Units> 98 | <JumpHistory HistoryIndex="-1"/> 99 | <RunParams> 100 | <FormatVersion Value="2"/> 101 | <Modes Count="0" ActiveMode=""/> 102 | </RunParams> 103 | </ProjectSession> 104 | <Debugging> 105 | <BreakPoints Count="5"> 106 | <Item1> 107 | <Kind Value="bpkSource"/> 108 | <WatchScope Value="wpsLocal"/> 109 | <WatchKind Value="wpkWrite"/> 110 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 111 | <Line Value="220"/> 112 | </Item1> 113 | <Item2> 114 | <Kind Value="bpkSource"/> 115 | <WatchScope Value="wpsLocal"/> 116 | <WatchKind Value="wpkWrite"/> 117 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 118 | <Line Value="236"/> 119 | </Item2> 120 | <Item3> 121 | <Kind Value="bpkSource"/> 122 | <WatchScope Value="wpsLocal"/> 123 | <WatchKind Value="wpkWrite"/> 124 | <Source Value="..\MSSQL\DAOMSSQL.lpr"/> 125 | <Line Value="112"/> 126 | </Item3> 127 | <Item4> 128 | <Kind Value="bpkSource"/> 129 | <WatchScope Value="wpsLocal"/> 130 | <WatchKind Value="wpkWrite"/> 131 | <Source Value="D:\Lazarus\fpcsrc\packages\rtl-objpas\src\inc\rtti.pp"/> 132 | <Line Value="2435"/> 133 | </Item4> 134 | <Item5> 135 | <Kind Value="bpkSource"/> 136 | <WatchScope Value="wpsLocal"/> 137 | <WatchKind Value="wpkWrite"/> 138 | <Source Value="..\..\..\Quick.DAO.Query.pas"/> 139 | <Line Value="407"/> 140 | </Item5> 141 | </BreakPoints> 142 | <Watches Count="2"> 143 | <Item1> 144 | <Expression Value="propertyname"/> 145 | </Item1> 146 | <Item2> 147 | <Expression Value="aFieldName"/> 148 | </Item2> 149 | </Watches> 150 | </Debugging> 151 | </CONFIG> 152 | --------------------------------------------------------------------------------