Skip to content

HTTPS clone URL

Subversion checkout URL

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