Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 143 lines (103 sloc) 7.229 kb
6b9a11a @ziminji Expanded and formatted the README file.
authored
1 # Objective-C SQL Query Builder
2
38f5a4c @ziminji Updating the text of the README to reflect recent changes.
authored
3 This Objective-C based project is divided up into four parts. The first part consists of a set of Objective-C
4264e26 @ziminji Moved classes to subfolder and added a new script to auto-generate model...
authored
4 classes that handle communications with an SQLite database. Inside the SRC folder, these Objective-C classes are
5 further subdivided into three folders. The DAO folder contains an SQLite wrapper class that easily manages the
6 database connection. The SQL folder contains a collection of SQL builder classes that can be used to construct
7 well-formed SQL statements for SQLite via a plethora of convenience methods similar to those found in LINQ. And,
8 the ORM folder contains an assortment of classes that can control and manipulate data within an SQLite database
9 via the Data Mapper and Active Record design patterns. The second part consists of an easy-to-use API, which
10 both documents and diagrams each class. The third part consists of a BASH script that can be used to generate
38f5a4c @ziminji Updating the text of the README to reflect recent changes.
authored
11 the necessary ORM models using the SQLite's database schema. And, the four part consists of the configuration
12 files for the DAO.
6b9a11a @ziminji Expanded and formatted the README file.
authored
13
cd7d654 @ziminji Edited text in README.
authored
14 All classes are designed to be used in iPhone/iOS applications.
6b9a11a @ziminji Expanded and formatted the README file.
authored
15
16 ## Motivation
17
4264e26 @ziminji Moved classes to subfolder and added a new script to auto-generate model...
authored
18 The goal of this project is to make these classes the "de facto" standard for communicating with SQLite databases on
19 iPhone/iOS devices.
6b9a11a @ziminji Expanded and formatted the README file.
authored
20
83b5987 @ziminji Updated text to include which files must be included.
authored
21 After looking at other Objective-C SQLite projects, it was obvious that there was a need for a lightweight Objective-C
22 library that offers more than just a set of SQLite wrapper classes. It was even more apparent that classes needed to be
23 written very cleanly and with clear naming conventions similar to those in LINQ. With the abundance of third-party
24 libraries for Objective-C, developers are craving libraries that are simple to learn and are intuitive. Therefore, the
25 classes in this repository are written with these observations in mind.
6b9a11a @ziminji Expanded and formatted the README file.
authored
26
27 ## Features
28
6a89b95 @ziminji Updating the ORM and the README.
authored
29 The following is a short-list of some of the features:
6b9a11a @ziminji Expanded and formatted the README file.
authored
30
1503655 @ziminji Adding an SQL builder class for ALTER TABLE and minor revisions to the R...
authored
31 * Implements a very simple, but powerful, Data Access Object (DAO) that wraps the sqlite3 C based functions.
3e49b97 @ziminji Debugged delete method in the ORM.
authored
32 * Automatically places the SQLite database in the "Document" directory.
e9bed93 @ziminji Minor edits.
authored
33 * Provides multi-threading support in the DAO to deal with asynchronous SQLite calls;
f995953 @ziminji Database connections are now configured using a PLIST file.
authored
34 * Utilizes a PLIST file for setting up connection configurations;
a57ca12 @ziminji Expanded on the README.
authored
35 * Executes an SQL statement with one line of code.
6dac00a @ziminji Refactored some common routines. Also, added some input checking to the...
authored
36 * Has a large collection of SQL builder classes with methods that mimic their SQL equivalent.
a57ca12 @ziminji Expanded on the README.
authored
37 * Helps ensure that SQL is well-formed.
465515d @ziminji Updated README.
authored
38 * Supports all major Objective-C datatypes, including NSNull, NSNumber, NSString, NSData, and NSDate.
a57ca12 @ziminji Expanded on the README.
authored
39 * Sanitizes data.
40 * Handles most complex queries.
41 * Works with raw SQL.
6a89b95 @ziminji Updating the ORM and the README.
authored
42 * Offers Object Relational Mapping (ORM) with composite primary keys.
43b74e5 @ziminji Refactored the ORM to conserve memory by using class methods instead of ...
authored
43 * Can auto-generate models (i.e. Active Records) for each table in the SQLite database via a BASH script.
a57ca12 @ziminji Expanded on the README.
authored
44 * Requires only those classes that are needed. Great for mobile development.
45 * Classes are easily extendible.
7698b86 @ziminji Added API.
authored
46 * Has clear API documentation generated via [Doxygen](http://www.stack.nl/~dimitri/doxygen/).
6b9a11a @ziminji Expanded and formatted the README file.
authored
47
48 ## Getting Started
49
83b5987 @ziminji Updated text to include which files must be included.
authored
50 Using these classes in an Xcode project is easy to do. Here is how:
6b9a11a @ziminji Expanded and formatted the README file.
authored
51
52 1. Download the source code via Github as a tarball (i.e. .tar.gz).
53 2. Navigate to the tarball in Finder.
3e49b97 @ziminji Debugged delete method in the ORM.
authored
54 3. Unarchive the tarball by double-clicking it in a Finder window.
6b9a11a @ziminji Expanded and formatted the README file.
authored
55 4. Open an Xcode project.
a57ca12 @ziminji Expanded on the README.
authored
56 5. Right-click on the "Classes" folder and click on the "Add >> Existing Files..." option.
57 6. Highlight the files, then click the "Add" button.
6b9a11a @ziminji Expanded and formatted the README file.
authored
58 7. Check "Copy items into destination group's folder (if needed)".
59 8. Select "Default" for the "Reference Type".
60 9. Choose "Recursively create groups for any added folders".
61 10. Click "Add".
62
83b5987 @ziminji Updated text to include which files must be included.
authored
63 ### Required Files
64
ec8d4e5 @ziminji Added a class method for queries that want to map to objects quickly. A...
authored
65 A lot of work has gone into making the classes in this repository as independent as possible; however, a few
6086b7a @ziminji Updating API and added SDK import files. Also, updated the README.
authored
66 dependencies just can't be avoided. To make life easier, the following SDK import files have been created to
67 make the implementation process as painless as possible:
68
69 * ZIMDaoSDK.h
70 * ZIMSqlSDK.h
71 * ZIMOrmSDK.h
72
ff89c65 @ziminji Minor updates to README and added a print statement to indicate that the...
authored
73 Based on which SDK is needed, only those classes listed (i.e. imported) in the SDK import file are needed to be
6086b7a @ziminji Updating API and added SDK import files. Also, updated the README.
authored
74 added to the respective Xcode project.
4b6f1e4 @ziminji Adding ORM details to README.
authored
75
ec8d4e5 @ziminji Added a class method for queries that want to map to objects quickly. A...
authored
76 ### Required Frameworks
77
78 To use these classes in an Xcode project, add the following framework:
79
80 * libsqlite3.dylib
81
6b9a11a @ziminji Expanded and formatted the README file.
authored
82 ### Documentation
83
7698b86 @ziminji Added API.
authored
84 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
85 respective ".h" file. You can also find more information on this repository's Wiki.
6b9a11a @ziminji Expanded and formatted the README file.
authored
86
83b5987 @ziminji Updated text to include which files must be included.
authored
87 ### Tutorials / Examples
6b9a11a @ziminji Expanded and formatted the README file.
authored
88
ec8d4e5 @ziminji Added a class method for queries that want to map to objects quickly. A...
authored
89 Checkout this repository's Wiki for a handful of examples. There, you will find examples on how to make an SQLite
90 database connection using the Data Access Object (DAO) and how to build Create, Read, Update, and Delete (CRUD)
91 statements.
6b9a11a @ziminji Expanded and formatted the README file.
authored
92
93 ## Reporting Bugs & Making Recommendations
94
95 Help debug the Objective-C classes in repository by reporting any bugs. The more detailed the report the better. If
e9bed93 @ziminji Minor edits.
authored
96 you have a bug-fix or a unit-test, please create an issue under the "Issues" tab of this repository and someone will
97 follow-up with it as soon as possible.
6b9a11a @ziminji Expanded and formatted the README file.
authored
98
99 Likewise, if you would like to make a recommendation on how to improve these classes, take the time to send a message
a57ca12 @ziminji Expanded on the README.
authored
100 so that it can be considered for an upcoming release. Or, if you would like to contribute to the development of this
101 repository, go ahead and create a fork.
102
ec8d4e5 @ziminji Added a class method for queries that want to map to objects quickly. A...
authored
103 You can also email any bug-fixes, unit-tests, or recommendations to oss@ziminji.com.
104
6dac00a @ziminji Refactored some common routines. Also, added some input checking to the...
authored
105 ### Known Issues
106
b0844cf @ziminji Fixed up text.
authored
107 Usually, code is not posted to this repository unless it works; however, there are times when some code may get posted
108 even though it still contains some bugs. When this occurs, every attempt will be made to list these known bugs in this
df7ab20 @ziminji Added a new section.
authored
109 README (if they are not already listed under the "Issues" tab).
6dac00a @ziminji Refactored some common routines. Also, added some input checking to the...
authored
110
6a89b95 @ziminji Updating the ORM and the README.
authored
111 At the current time, there are no known bugs. However, the Object Relational Modeling (ORM) is still in development.
6dac00a @ziminji Refactored some common routines. Also, added some input checking to the...
authored
112
df7ab20 @ziminji Added a new section.
authored
113 ### Updates
114
115 This project is updated frequently with bug-fixes and new features. Be sure to add this repository to your watch list
116 so that you can be notified when such updates are made.
117
a57ca12 @ziminji Expanded on the README.
authored
118 ## Future Development
119
120 This project is under heavy development. There are development plans to add:
121
38f5a4c @ziminji Updating the text of the README to reflect recent changes.
authored
122 * The ability to process more than one SQL statement at a time in the Data Access Object (DAO);
a57ca12 @ziminji Expanded on the README.
authored
123 * More SQL builder classes;
7698b86 @ziminji Added API.
authored
124 * The ability to handle foreign keys via SQL builder classes and Active Record;
4264e26 @ziminji Moved classes to subfolder and added a new script to auto-generate model...
authored
125 * Lazy loading;
126 * A module to handle pagination;
ff89c65 @ziminji Minor updates to README and added a print statement to indicate that the...
authored
127 * A set of utility classes;
a57ca12 @ziminji Expanded on the README.
authored
128 * Unit-tests;
83b5987 @ziminji Updated text to include which files must be included.
authored
129 * Additional tutorials and examples.
6b9a11a @ziminji Expanded and formatted the README file.
authored
130
131 ## License (Apache v2.0)
132
133 Copyright 2011 Ziminji
134
a57ca12 @ziminji Expanded on the README.
authored
135 Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the
cd7d654 @ziminji Edited text in README.
authored
136 License. You may obtain a copy of the License at:
6b9a11a @ziminji Expanded and formatted the README file.
authored
137
138 [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
139
cd7d654 @ziminji Edited text in README.
authored
140 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
141 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
142 language governing permissions and limitations under the License.
Something went wrong with that request. Please try again.