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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>