Skip to content
This repository
Newer
Older
100644 155 lines (112 sloc) 8.215 kb
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
1 # Objective-C SQL Query Builder
2
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
3 This Objective-C SQLite projects is a lightweight library that offers more than just a set of SQLite wrapper classes.
4 It is divided up into four parts. The first part consists of a set of Objective-C classes that handle communications
5 with an SQLite database. Inside the "src" folder, these Objective-C classes are further subdivided into five folders.
6 The "db" folder (formerly, the "dao" folder) contains an SQLite wrapper class that easily manages the database connection.
7 The "ext" folder contains some class extensions. The "sql" folder contains a collection of SQL builder classes that can
8 be used to construct well-formed SQL statements for SQLite via a plethora of convenience methods similar to those found
9 in LINQ. Likewise, the "orm" folder has an assortment of classes that can control and manipulate data within an SQLite
10 database via the Active Record design pattern. And, the "util" folder contains a set of various helper classes. The
11 second part consists of an easy-to-read API, which both documents and diagrams each Objective-C class. The third part
12 consists of a BASH script that can be used to generate the necessary ORM models using the SQLite's database schema. The
13 fourth part consists of the database configuration files for the SQLite database connection.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
14
cd7d6540 »
2011-03-27 Edited text in README.
15 All classes are designed to be used in iPhone/iOS applications.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
16
17 ## Motivation
18
4264e262 »
2011-04-09 Moved classes to subfolder and added a new script to auto-generate mo…
19 The goal of this project is to make these classes the "de facto" standard for communicating with SQLite databases on
20 iPhone/iOS devices.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
21
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
22 With the abundance of third-party libraries for Objective-C, it was apparent that a successful SQLite library needs to
23 be simple to learn and intuitive. It also must be cleanly written with clear naming conventions and must be well-documented
24 for too many SQLite libraries are hard to understand and are not user-friendly. For these reasons, this SQLite library was
25 written.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
26
27 ## Features
28
6a89b950 »
2011-04-03 Updating the ORM and the README.
29 The following is a short-list of some of the features:
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
30
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
31 * Cleanly wraps-up the sqlite3 C based functions.
3e49b976 »
2011-04-10 Debugged delete method in the ORM.
32 * Automatically places the SQLite database in the "Document" directory.
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
33 * Provides multi-threading support for asynchronous SQLite database calls;
f9959537 »
2011-04-16 Database connections are now configured using a PLIST file.
34 * Utilizes a PLIST file for setting up connection configurations;
00850caa »
2011-06-30 Added privilege restrictions; fixed some missing semicolons; and upda…
35 * Allows database privileges to be restricted.
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
36 * Has an easy to use SQLite database connection pool.
37 * Capable of executing an SQL statement with one line of code.
38 * Has a huge collection of SQL builder classes with methods that mimic their SQL statement equivalents.
39 * Helps ensure that SQL statement are well-formed.
0aa7722a »
2011-07-02 Changed the way floats and doubles are handled.
40 * Supports all major Objective-C datatypes, including NSNull, NSNumber, NSDecimalNumber, NSString, NSData, and NSDate.
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
41 * Sanitizes data using best practices.
42 * Handles most complex queries and works with raw SQL statements.
43 * Has a powerful SQLite tokenizer.
44 * Has a data access layer (DAL) that offers Object Relational Mapping (ORM).
45 * Data access objects (DAO) handle composite primary keys.
46 * Via a Bash script, models (i.e. Active Records) can be auto-generated for each table in the SQLite database.
cf32a722 »
2011-05-01 Adding foreign key support.
47 * Handles foreign keys via true lazy loading.
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
48 * Requires only those Objective-C classes that are absolutely needed.
a57ca12a »
2011-03-28 Expanded on the README.
49 * Classes are easily extendible.
7698b862 »
2011-04-05 Added API.
50 * Has clear API documentation generated via [Doxygen](http://www.stack.nl/~dimitri/doxygen/).
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
51
52 ## Getting Started
53
83b5987a »
2011-04-01 Updated text to include which files must be included.
54 Using these classes in an Xcode project is easy to do. Here is how:
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
55
56 1. Download the source code via Github as a tarball (i.e. .tar.gz).
57 2. Navigate to the tarball in Finder.
3e49b976 »
2011-04-10 Debugged delete method in the ORM.
58 3. Unarchive the tarball by double-clicking it in a Finder window.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
59 4. Open an Xcode project.
a57ca12a »
2011-03-28 Expanded on the README.
60 5. Right-click on the "Classes" folder and click on the "Add >> Existing Files..." option.
61 6. Highlight the files, then click the "Add" button.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
62 7. Check "Copy items into destination group's folder (if needed)".
63 8. Select "Default" for the "Reference Type".
64 9. Choose "Recursively create groups for any added folders".
65 10. Click "Add".
66
83b5987a »
2011-04-01 Updated text to include which files must be included.
67 ### Required Files
68
ec8d4e51 »
2011-04-03 Added a class method for queries that want to map to objects quickly.…
69 A lot of work has gone into making the classes in this repository as independent as possible; however, a few
6086b7a0 »
2011-04-09 Updating API and added SDK import files. Also, updated the README.
70 dependencies just can't be avoided. To make life easier, the following SDK import files have been created to
71 make the implementation process as painless as possible:
72
4c867ef2 »
2011-07-16 Major renaming. ZIMDao... to ZIMDb..., ...SDK to ...Sdk, ...ExtString…
73 * ZIMDaoSdk.h
74 * ZIMSqlSdk.h
75 * ZIMOrmSdk.h
6086b7a0 »
2011-04-09 Updating API and added SDK import files. Also, updated the README.
76
ff89c65c »
2011-04-09 Minor updates to README and added a print statement to indicate that …
77 Based on which SDK is needed, only those classes listed (i.e. imported) in the SDK import file are needed to be
6086b7a0 »
2011-04-09 Updating API and added SDK import files. Also, updated the README.
78 added to the respective Xcode project.
4b6f1e42 »
2011-04-03 Adding ORM details to README.
79
ec8d4e51 »
2011-04-03 Added a class method for queries that want to map to objects quickly.…
80 ### Required Frameworks
81
641214b9 »
2011-07-01 Updated the model generator to reflect changes to the PLIST file. Als…
82 To use these Objective-C classes in an Xcode project, add the following framework:
ec8d4e51 »
2011-04-03 Added a class method for queries that want to map to objects quickly.…
83
84 * libsqlite3.dylib
85
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
86 ### Documentation
87
7698b862 »
2011-04-05 Added API.
88 All classes are heavily documented using [HeaderDoc](http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html#//apple_ref/doc/uid/TP40001215-CH345-SW1). You can get familiar with each class by simply looking at the API or by opening its
89 respective ".h" file. You can also find more information on this repository's Wiki.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
90
83b5987a »
2011-04-01 Updated text to include which files must be included.
91 ### Tutorials / Examples
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
92
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
93 Checkout this SQLite repository's Wiki for a handful of examples. There, you will find examples on how to make
94 an SQLite database connection and how to build DCL, DDL, DML, and TCL commands (including Create, Read, Update,
95 and Delete (CRUD) statements). The Wiki also has tutorials on how to use Object Relational Mapping (ORM) and
96 how to generate the necessary models (i.e. active records).
641214b9 »
2011-07-01 Updated the model generator to reflect changes to the PLIST file. Als…
97
98 ### Further Assistance
99
100 If you need further assistance in implementing these classes, you can always send an email to oss@ziminji.com with
e48bac75 »
2011-07-02 Fixed a hyperlink and clarified some text.
101 any questions that you may have about this repository. Any frequently asked questions (FAQ) will be posted on this
102 repository's Wiki.
641214b9 »
2011-07-01 Updated the model generator to reflect changes to the PLIST file. Als…
103
e48bac75 »
2011-07-02 Fixed a hyperlink and clarified some text.
104 You can also seek assistance via the blogs. A great Web site for community assistance is [Stack Overflow](http://stackoverflow.com).
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
105
106 ## Reporting Bugs & Making Recommendations
107
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
108 Help debug the code in repository by reporting any bugs. The more detailed the report the better. If you have a bug-fix
109 or a unit-test, please create an issue under the "Issues" tab of this repository and someone will follow-up with it as
110 soon as possible.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
111
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
112 Likewise, if you would like to make a recommendation on how to improve the code in this repository, take the time to send
113 a message so that it can be considered for an upcoming release. Or, if you would like to contribute to the development of
114 this Objective-C SQLite repository, go ahead and create a fork.
a57ca12a »
2011-03-28 Expanded on the README.
115
ec8d4e51 »
2011-04-03 Added a class method for queries that want to map to objects quickly.…
116 You can also email any bug-fixes, unit-tests, or recommendations to oss@ziminji.com.
117
6dac00a8 »
2011-04-01 Refactored some common routines. Also, added some input checking to t…
118 ### Known Issues
119
b0844cf7 »
2011-04-01 Fixed up text.
120 Usually, code is not posted to this repository unless it works; however, there are times when some code may get posted
121 even though it still contains some bugs. When this occurs, every attempt will be made to list these known bugs in this
df7ab208 »
2011-04-10 Added a new section.
122 README (if they are not already listed under the "Issues" tab).
6dac00a8 »
2011-04-01 Refactored some common routines. Also, added some input checking to t…
123
8577d07f »
2011-07-02 Made minor improvements to builder classes. Worked on improving expre…
124 At the current time, there are no known bugs.
6dac00a8 »
2011-04-01 Refactored some common routines. Also, added some input checking to t…
125
df7ab208 »
2011-04-10 Added a new section.
126 ### Updates
127
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
128 This Objective-C SQLite project is updated frequently with bug-fixes and new features. Be sure to add this repository
129 to your watch list so that you can be notified when such updates are made.
df7ab208 »
2011-04-10 Added a new section.
130
a57ca12a »
2011-03-28 Expanded on the README.
131 ## Future Development
132
133 This project is under heavy development. There are development plans to add:
134
34b3ee11 »
2011-07-07 Adding hashing algorithms.
135 * More SQL builder classes;
783ce5fb »
2011-07-17 Adding a database connection pool and updated both the readme and API…
136 * The ability to parse raw SQLite statements into their equivalent SQL builder classes;
137 * The ability to process more than one SQL statement at a time;
138 * More utilities (e.g. classes to handle validation, filters, imports, exports, pagination, partitioning, and migration);
482d9557 »
2011-04-28 Adding a load/reload method to the ORM Model class.
139 * A database encryption layer for password protecting an SQLite database;
a57ca12a »
2011-03-28 Expanded on the README.
140 * Unit-tests;
83b5987a »
2011-04-01 Updated text to include which files must be included.
141 * Additional tutorials and examples.
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
142
143 ## License (Apache v2.0)
144
145 Copyright 2011 Ziminji
146
a57ca12a »
2011-03-28 Expanded on the README.
147 Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the
cd7d6540 »
2011-03-27 Edited text in README.
148 License. You may obtain a copy of the License at:
6b9a11a9 »
2011-03-27 Expanded and formatted the README file.
149
150 [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
151
cd7d6540 »
2011-03-27 Edited text in README.
152 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
153 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
154 language governing permissions and limitations under the License.
Something went wrong with that request. Please try again.