Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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