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

324 Коммитов

Автор SHA1 Сообщение Дата
Stephen Celis d287345320 Upgrade Playground
It's not as pretty, but it's the only supported solution.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-16 11:18:31 -04:00
Stephen Celis 3abd6213b2 Merge pull request #104 from confile/patch-1
Insert alternative transaction statement
2015-04-14 17:53:01 -04:00
Stephen Celis 4def261613 Add missing import
The early module map refactor left SQLCipher users high and dry :(

This should fix #100.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-14 10:38:19 -04:00
Confile 2b0abb08ac Insert alternative transaction statement 2015-04-14 16:00:17 +02:00
Stephen Celis 8215629535 Clarify iOS 7 instructions
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-13 14:34:49 -04:00
Stephen Celis 3e8f7d3bfd Update installation image
SQLite.swift is a universal framework now, so let's avoid any confusion.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-12 21:36:04 -04:00
Stephen Celis 1474f15eb5 Clarify SQLCipher installation
It's no longer hidden away in a "Vendor" group.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-12 20:12:43 -04:00
Stephen Celis 44820eab11 Update SQLCipher
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-12 20:07:32 -04:00
Stephen Celis 8749e2ec2f Don't embed subframework
It's primarily there for compilation.

A fix for App Store rejections ITMS-90205 and ITMS-90206 (closes #88).

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-12 14:13:14 -04:00
Stephen Celis 31752f0319 Update OS X header to point to SDK
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-12 13:28:55 -04:00
Stephen Celis 849d4efe86 Support IN condition against subquery
Closes #94

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-11 10:27:24 -04:00
Stephen Celis fc086d0db4 Swift 1.2 GM
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-08 18:29:29 -07:00
Stephen Celis 2cc0a17243 Make assertionFailures fatalErrors
Should prevent compilation errors for certain schemes.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-04-08 17:55:58 -07:00
Stephen Celis 0708a2705c Tighten naming conventions with SQLite
We should prefer, in the raw interface, at least, the same naming
conventions as SQLite. This should make it easier to transition with
less of a need to reference the documentation.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:45:48 -07:00
Stephen Celis ad8ec5844d Conventionally mark Objective-C implementation details private
Basically, prefix "_" all the things. Ideally we could hide these
implementation details altogether, but it doesn't appear to be possible
in a Swift framework (yet).

Additionally, by creating and casting our own opaque structs in the
"bridging" header, we can avoid exposing the inner sqlite3 module.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:32:26 -07:00
Stephen Celis 550c1df43c Ess, queue, el.
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:55 -07:00
Stephen Celis 9d83e2f3fa Remove unnecessary abstraction
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:55 -07:00
Stephen Celis 6abd3f4f31 Update, commit, and rollback hook support
Should make it easy, e.g., to create an interface for a table view to
register for updates.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:55 -07:00
Stephen Celis 540df5941a Add parameter names to callback functions
Makes things more intelligible when autocompleting functions and their
closures.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:55 -07:00
Stephen Celis 05cf90fbf7 Query interrupt support
Adds the ability to interrupt a database connection during a
long-running query.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 24cd405169 Plug C block memory leaks
The database connection can retain them well enough.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 1fea119c0a Mark transaction/savepoint block helpers @noescape
They execute immediately, so there's no reason to worry about capture
semantics.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis f02b75a930 Mark create(table:) @noescape
This removes the `self.` requirement from the block, which should lead
to better legibility in some cases.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 628a2893c0 Use an embedded module instead of a bridging header
I'd taken advantage of the fact that renaming the umbrella header
disabled the framework bridging header check, which is a bug and could
stop working at any moment.

Instead, let's embed a `sqlite3` framework module that points to the
appropriate system header.

As soon as the system provides an appropriate `sqlite3` module at the
system level, we merely have to delete this internal dependency.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis a06a550ddd Custom Tokenizers
This brings preliminary support for custom FTS tokenizers, registered
using the following incantation:

    db.register(tokenizer: "name") { input in
        // ... extract first token and range here
        return (token, range) // return normalized token and range
    }

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 5ac56d78c0 Swift 1.2 beta 3
Nested functions no longer require `self`.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Sam Sherar b1b27d5db5 Updating documentation for forced downcast 2015-03-28 13:28:54 -07:00
Stephen Celis 440579e36d Enable -whole-module-optimization
A feature of Swift 1.2. Slows builds down when the framework first
builds and whenever it changes, but performs significantly faster.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis ae868916ea Swift 1.2 beta 2
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 5532303135 Swift 1.2 beta 1
Most things should work as they have been, with a few notes:

  - The `db.transaction` helpers that took variadic auto-closures have
    been removed (Swift no longer supports variadic auto-closures).
    Update path: use `&&` and `||` for control flow:

        db.transaction() &&
            stmt1 &&
            stmt2 &&
            db.commit() || db.rollback()

    Or use the block-based helper:

        db.transaction { _ in
            stmt1.run()
            if stmt1.failed { return .Rollback }
            stmt2.run()
            if stmt2.failed { return .Rollback }
            return .Commit
        }

    Note: You'll need to explicitly call/return COMMIT and ROLLBACK now.

  - There appears to be a bug in Swift causing 2 memory-related,
    over-releasing crashes in the test suite. Filed: rdar://19782170

Many bugs marked FIXME with links to rdars are now fixable and have been
fixed.

The tests have also been heavily refactored (they were abusing the power
of `@autoclosure`, which has been curtailed with `@noescape`), but
should be generally more readable, if slightly less flexible.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-28 13:28:54 -07:00
Stephen Celis 83f08f7215 Add argument count to create(function:)
Allows for the definition of multiple functions with the same name but a
differing number of arguments.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-22 10:41:13 -07:00
Stephen Celis 6f3eef7619 Basic R*Tree module support
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-21 11:57:58 -07:00
Stephen Celis c82559f6e5 Document FTS
And update a few other documentation-related things along the way.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-21 11:28:24 -07:00
Stephen Celis 4521c35827 README cleanup
- Stop using numeric link references.
 - Document discrepancy between SQLCipher and FTS4

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-21 10:58:06 -07:00
Stephen Celis e0e94a3bd6 Highlight unhighlighted documentation
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-21 10:32:53 -07:00
Stephen Celis 83bbd896fa Fix some old archive-only segfaults
Looking forward to Swift 1.2!

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-11 09:10:35 -07:00
Stephen Celis ae7d539f4d Update for Xcode 6.2
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-11 09:10:15 -07:00
Stephen Celis 86af78632b Always remove inferred types
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-08 16:47:33 -07:00
Stephen Celis ba9a175e73 Prefer tuple assignment in initializers
For now, anyhow. Style changes, after all.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-08 16:47:33 -07:00
Stephen Celis c7c5cf9524 Very basic FTS support
This commit provides basic helpers for creating virtual tables with
fts4() and for running match queries against them.

Still needed:

 - Custom tokenizer support (and the ability to build with "unicode61"
   and "icu" tokenizers)

 - Better support for offsets(), snippet(), matchinfo()

 - Additional FTS4 options: http://www.sqlite.org/fts3.html#fts4_options

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-08 16:47:33 -07:00
Stephen Celis 96f4b35dec PRIMARY KEY cleanup
Let's enable defaults for primary keys, and let's not bother with a
uniqueness parameter, since it's implied.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-05 18:03:56 -08:00
Stephen Celis a705c40e7c Merge pull request #78 from xenadu/master
Support non-integer primary key in shorthand function
2015-03-05 16:28:06 -08:00
Russ Bishop 2b3780ccca Support non-integer primary key in shorthand function 2015-03-05 16:25:18 -08:00
Stephen Celis 10ce76ff94 Fix Makefile SLOC check
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 15:24:38 -08:00
Stephen Celis 87946a6e95 Fix column access on joined subqueries
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 15:24:12 -08:00
Stephen Celis 0ba651defd Basic subquery support
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 14:31:19 -08:00
Stephen Celis 1efaf8b87b Change ALTER TABLE RENAME TO signature
This is mainly important for migrations, so let's take the old table
name as a string and pass in a query as the new table, instead.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 13:37:50 -08:00
Stephen Celis 992bb380a8 Re-use expression aliasing on a query's table
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 13:34:03 -08:00
Stephen Celis b8c6605c38 Remove unnecessary typealiasing
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 12:27:14 -08:00
Stephen Celis 0d6c641245 It's technically a rowid, not a row id
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
2015-03-03 12:07:19 -08:00