README.md

This commit is contained in:
Gwendal Roué committed 2016-09-15 07:24:20 +02:00
1 parent 1cd887d3ec
commit 8f1844921e
1 file changed
-19
-19
View File
@@ -46,25 +46,6 @@ More than a set of tools that leverage SQLite abilities, GRDB is also:
For a general overview of how a protocol-oriented library impacts database accesses, have a look at [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3).
### The GRDB Advantage
GRBD addresses your database needs, like other great Swift database libraries: [FMDB](https://github.com/ccgus/fmdb), [SQLite.swift](http://github.com/stephencelis/SQLite.swift/pulls), [Core Data](core data swift), or [Realm](https://realm.io).
**Indulge yourself and let GRDB run the extra mile for you:**
1. **Great SQL support**. Other libraries make you feel dirty when you use raw SQL, or leave you naked when you have to turn database data into application values and objects. *GRDB welcomes your SQL skills, and you will feel it.* See the [SQL API](#sqlite-api).
2. **Flexible Records**. Nobody wants to deal with raw SQL rows all day long. FMDB and SQLite.swift won't help you converting them to and from Swift structs or classes. FMDB has [marcoarment/FCModel](https://github.com/marcoarment/FCModel), but it relies on Key-Value-Observing - which does not fit very well with Swift. Core Data and Realm objects are a pain to use in a multi-threaded environment. *GRDB provides ready-made Swift protocols that turn your custom structs and classes into records that you can freely fetch and store in the database.* See [records](#records) and the [query interface](#the-query-interface).
3. **Threading confidence**. Core Data is quite error-prone as soon as your application leaves the trivial zone. SQLite.swift is easy to misuse in a multi-threaded application. Realm prevents sharing records between threads. FMDB has no support for [WAL mode](https://www.sqlite.org/wal.html). *GRDB builds on top of protocol-oriented programming and immutability to provide a sane and efficient threading environment.* See [Four different ways to handle SQLite concurrency](https://medium.com/@gwendal.roue/four-different-ways-to-handle-sqlite-concurrency-db3bcc74d00e) and [How to build an iOS application with SQLite and GRDB.swift](https://medium.com/@gwendal.roue/how-to-build-an-ios-application-with-sqlite-and-grdb-swift-d023a06c29b3).
4. **Performance**. GRDB [performs better](https://github.com/groue/GRDB.swift/wiki/Performance). And it supports SQLite [WAL mode](https://www.sqlite.org/wal.html) that brings extra performance to multi-threaded applications.
5. **Sensible error handling**. While FMDB makes it easy to overlook errors, SQLite.swift treats your local database as if it was some dangerous poison downloaded from Internet. *GRDB won't let any error go, and yet doesn't force you to handle errors that simply shouldn't happen.* See [error handling](#error-handling) for more information.
6. **API Design**. Do you sometimes find that SQLite.swift is hard to remember and use correctly, or that FMDB is somewhat verbose? *Give GRDB a try.*
## Usage
Open a [connection](#database-connections) to the database: