Граф коммитов

324 Коммитов

Автор SHA1 Сообщение Дата
Stephen Celis 03b27f9a5f Fix General Query.delete() documentation
Fixes #179.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-08-18 19:16:28 -07:00
Stephen Celis 043137e132 Coverage improvements
Because "age" is already an Expression<Int?>, many test paths weren't
being hit.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-08-18 19:07:48 -07:00
Stephen Celis 89d16192bb Merge pull request #153 from huynhphan89/master
Add select functions with array param for query builder
2015-07-15 08:13:08 -04:00
huynhpl f791d36a60 Add select functions with array param for query builder 2015-07-15 09:41:56 +07:00
Stephen Celis fde8c3391b SwiftCov support
84.8% coverage so far.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-06-07 12:21:53 -04:00
Stephen Celis 743530d1e5 Update Installation image
Let's not let things go stale.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-31 08:49:11 -04:00
Stephen Celis 0fcd4af08f Indent manual SQLCipher instructions under manual
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-30 21:33:01 -04:00
Stephen Celis 3f08767c85 Restore Travis
Finally ;) Xcode 6.3 support:

http://blog.travis-ci.com/2015-05-26-xcode-63-beta-general-availability/

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-30 21:28:23 -04:00
Stephen Celis 9dd044657d More direction for CocoaPods users
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-19 22:36:41 -04:00
Stephen Celis e125805642 SQLCipher CocoaPods support
Using a sub-spec, it's easy to use SQLCipher, as well:

    pod 'SQLite.swift/Cipher', git: # ...

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-19 22:25:26 -04:00
Stephen Celis 9bfae5c0b5 Playground updates
Document the new way of initializing database connections. And stop
saying "instantiate" all the time.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-17 21:50:42 -04:00
Stephen Celis 7627523bd5 CocoaPods support
With 0.37, we get custom module map support, and with that we can cobble
together a working framework!

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-17 20:12:22 -04:00
Stephen Celis 8f64e357c3 Remove dummy framework
We can load the SDK header from our custom module map, instead.

Let's also link to the iphoneos SDK header, since it shouldn't matter:
it's always identical to the iphonesimulator header, and at worst a
version behind the macosx header.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-17 19:08:23 -04:00
Stephen Celis 1721297688 Stop nagging me, Xcode
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-16 18:24:48 -04:00
Stephen Celis 6e71ca9c14 Simplify lazy variables
No need for a closure for one-liners.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:48:44 -04:00
Stephen Celis 27f0bf8caf Add nullability attributes to Objective-C code
Just a small improvement for the code internally.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:46:56 -04:00
Stephen Celis cd5567b95e Documentation improvements
Generally: formatting is better than none. And documentation is better
than none.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:46:21 -04:00
Stephen Celis 17e0f96d8b Simplify limit() logic
At least for the functional mindset. A short one-liner should be more
readable than an if-else.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:45:08 -04:00
Stephen Celis 6d9fb5c6ea Remove private group() function
It's used as a funnel and shouldn't be called directly. After all,
`having: nil` makes no sense.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:44:04 -04:00
Stephen Celis 6bc2aed199 Document the collation enumeration
It deserves it.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:43:24 -04:00
Stephen Celis 895282da9d Remove unnecessary default
There's no reason to initialize an expression literal without a SQL
string.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:42:32 -04:00
Stephen Celis 7749e3ee79 Make `lastError` optional
Return it only when the result code is an error code.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:41:39 -04:00
Stephen Celis 3203dfdf53 Better document defaults
And fix the documentation for the create function shims while we're at
it.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:40:20 -04:00
Stephen Celis c4cba1d833 Make Database initialization more Swift-like
Carrying over ":memory:" and "" seems less-than-ideal.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:37:59 -04:00
Stephen Celis ef9c07c1d2 Simplify asynchronous testing
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-13 19:35:39 -04:00
Stephen Celis 5794555c91 Standardize void types
Let's follow the Apple convention:

  - () for parameters
  - Void for return types

https://devforums.apple.com/message/1133616#1133616

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-12 18:52:35 -04:00
Stephen Celis 533e47e6d5 Swift prefers camelCase
Pulling snake_case over for an interface isn't necessary.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-06 18:31:26 -04:00
Stephen Celis e7fbda4ebd Update requirements in documentation
This is why you keep it DRY.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-06 18:31:26 -04:00
Stephen Celis effa1bf832 Update Contributing Guidelines
This should assist some users on their way to submitting an issue or
shortly thereafter.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-06 18:31:26 -04:00
Stephen Celis 3a0435ebce Update README for insert/update/delete changes
It's no longer overload soup.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-02 23:21:54 -04:00
Stephen Celis 868b379ee3 Better examples
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-02 10:48:14 -04:00
Stephen Celis b5aabd0881 Consistency
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-02 10:47:53 -04:00
Stephen Celis a5011f4a21 Simplify query change interface
The fact that `insert()`, `update()`, and `delete()` have a number of
overloads that can only be disambiguated by specifying a type, a tuple
member, or `!` is a big point of confusion for new users of
SQLite.swift. The overloads add some interesting patterns to the mix,
but aren't worth the pain points.

If we eliminate the overloads, we can insert/update/delete in place.
This allows for subtle bugs to be introduced into apps (where the
developer doesn't check for a rowid or that an update/delete was
successful), but is a tradeoff we'll have to make. It doesn't make sense
to enforce a different kind of interface/access at the expense of
confusion.

Given:

    let user = email <- "alice@mac.com")

The old way:

    users.insert(user)!
    let rowid = users.insert(user)!
    if let rowid = users.insert(user) { /* ... */ }
    let (rowid, statement) = users.insert(user)
    // etc.

The new way:

    users.insert(user)
    let rowid = users.insert(user).rowid!
    if let rowid = users.insert(user).rowid { /* ... */ }
    let (rowid, statement) = users.insert(user)
    // etc.

Slightly and rarely more verbose and readable, with less confusing
compiler errors and hand-holding.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-05-02 10:37:37 -04:00
Stephen Celis 14573e4c83 Remove replace(...) in favor of insert(or:...)
It's more flexible to expose all the ON CONFLICT actions.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-30 09:40:53 -04:00
Stephen Celis 38a585c470 Make rowid public
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-30 09:37:37 -04:00
Stephen Celis e19813d0a3 Expose REGEXP operator
Still need to create(function: "regexp") yourself.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-30 09:36:49 -04:00
Stephen Celis 532a3777cc Make aggregate function shims private
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-30 09:35:45 -04:00
Stephen Celis 610138e7f8 UTF-8 the docs
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-30 09:34:55 -04:00
Stephen Celis 036288a8dd Revert "Use single module map file for sqlite3 shim"
This reverts commit 2bf90d49cc.

It looks like the module map's path is not relative to the SDK root
after all (as seen by reporters of #120).
2015-04-28 08:40:44 -04:00
Stephen Celis cb71a4339a Disable App Extension requirement for test targets
Otherwise we get a warning every time we build them.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-27 09:14:33 -04:00
Stephen Celis 2bf90d49cc Use single module map file for sqlite3 shim
Per the following:

https://twitter.com/jckarter/status/590928617770602496

Fixes #116.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-27 09:01:42 -04:00
Stephen Celis 213920b2f6 Fix ALTER TABLE documentation
Copypasta typically tastes a bit funny.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-27 08:51:06 -04:00
Stephen Celis 8a85d80b0e DRY up project configuration
Let's utilize the xcconfig file where we can. In this case, ensure that
the 8.0 deployment target applies to everything.

Fixes #119.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-27 08:49:55 -04:00
Stephen Celis 1db85271f2 Clarify what kinds of Frameworkless bugs to report
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-24 09:32:50 -04:00
Stephen Celis 7844bf715a Move fts3_tokenizer to ease Frameworkless Target install
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-24 09:30:31 -04:00
Stefan Arentz 078a76b6b7 Change the deployment target to 8.0 2015-04-21 14:02:27 -04:00
Stefan Arentz 60d523c298 Set Allow App Extension API Only 2015-04-21 14:02:07 -04:00
Stephen Celis 571f9a5a6e Don't drop offset when fetching first row
Fixes #110.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-19 08:35:49 -04:00
Stephen Celis 38b50fc116 Add basic contributing guidelines
A word-for-word of the README's "Communication" section, for now, but
hopefully it'll steer more people looking for general help toward Stack
Overflow.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-17 19:03:22 -04:00
Stephen Celis 09466f34f2 Update Apple documentation link
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-17 18:52:33 -04:00