swiftlyfalling
901b7a0f12
Add support for SQLite Pre-Update Hooks (+ tests)
...
If SQLITE_ENABLE_PREUPDATE_HOOK is defined, and GRDB is built with a
custom SQLite library with the functionality (see: GRDBCustomSQLite),
enable support for SQLite Pre-Update Hooks and the new
`willChangeWithEvent` callback on TransactionObservers.
2016-06-01 20:42:21 -04:00
swiftlyfalling
5cb4044408
Merge remote-tracking branch 'groue/master' into Custom-SQLite
2016-05-31 17:33:59 -04:00
Gwendal Roué
df5a327da4
Top-level Database.inSavepoint opens a transaction if the default transaction kind is not DEFERRED
2016-05-31 13:09:33 +02:00
Gwendal Roué
fe7e39776b
Documentation
2016-05-31 06:49:35 +02:00
Gwendal Roué
da33e480c3
Improve Database.execute() detection of white-space string endings
2016-05-31 06:47:44 +02:00
swiftlyfalling
30bc7e4f6c
Replace most uses of #if SQLITE_HAS_CODEC with the appropriate USING_BUILTIN_SQLITE or USING_SQLCIPHER defines.
...
This enables easier compilation of a custom version of SQLite that
itself uses the SQLITE_HAS_CODEC define. (ex. If building SQLite with
the SQLite Encryption Extension.)
The SQLITE_HAS_CODEC define is now only used to guard use of the SQLite
encryption APIs.
GRDBCipher builds define USING_BUILTIN_SQLITE and USING_SQLCIPHER.
2016-05-30 18:19:45 -04:00
Gwendal Roué
90f304a881
Typo
2016-05-30 12:33:42 +02:00
Gwendal Roué
ce7736a4b8
Failed statements can not be reused: remove them from the statement cache.
2016-05-30 12:21:20 +02:00
Gwendal Roué
9d00189ac0
Inner Documentation
2016-05-30 07:46:40 +02:00
Gwendal Roué
3af2d7c0df
Inner Documentation
2016-05-29 20:03:33 +02:00
Gwendal Roué
098e9fee8c
Issue #61 : TODO
2016-05-28 20:40:51 +02:00
Gwendal Roué
ee7f505cde
Issue #61 : add savepoint sanity check
2016-05-28 20:39:02 +02:00
Gwendal Roué
4581850b05
Issue #61 : since savepoint names can be reused and nested, there is no purpose forcing the user to name them: use a single default savepoint name. And provide thorough testing.
2016-05-28 18:57:07 +02:00
Gwendal Roué
bc757016af
Issue #61 : Database.inSavepoint(named:)
2016-05-28 18:46:12 +02:00
Gwendal Roué
2cf606bdbd
Issue #61 : pass all tests for TransactionObserver and savepoints :-)
2016-05-28 15:59:20 +02:00
Gwendal Roué
03a5671bb0
Issue #61 : prevent SelectStatement from hiding the update statements we track
2016-05-28 14:51:54 +02:00
Gwendal Roué
37c16fbb48
Issue #61 : recognize savepoints statements
2016-05-28 14:44:37 +02:00
Gwendal Roué
92431f20d7
Issue #61 : DatabaseEvent.copy() returns an event that can outlive a transaction observer’s databaseDidChangeWithEvent callback.
2016-05-28 14:27:25 +02:00
Gwendal Roué
8d540751e1
Issue #60 : PrimaryKey documentation
2016-05-28 12:03:58 +02:00
Gwendal Roué
fc8b2ee679
Issue #60 : make cachedUpdateStatement() and cachedSelectStatement() public
2016-05-25 08:55:05 +02:00
Gwendal Roué
bc512e775c
Issue #60 : make PrimaryKey public
2016-05-25 08:41:54 +02:00
Gwendal Roué
9794b72607
Fixes #55
2016-05-21 15:08:16 +02:00
Gwendal Roué
9dbf992c40
Configuration.maximumReaderCount replaces DatabasePool initializer option
2016-05-19 18:10:36 +02:00
Gwendal Roué
92e1336db0
Fix issue #54
2016-05-19 14:00:45 +02:00
Gwendal Roué
60fafd399f
Fix Database closing in GRDBCipher targets
2016-05-18 19:20:09 +02:00
Gwendal Roué
f553f2d2b0
Remove Row subscripting by column name; row.databaseValue(named:) returns an optional DatabaseValue
2016-05-18 19:03:29 +02:00
Gwendal Roué
a7266e38c4
Issue #51 : Database.close() logs when sqlite_close() fails
2016-05-17 20:30:50 +02:00
Gwendal Roué
c1169f0d2c
Issue #51 : Restore statement caching, now that the database is closed in the correct queue.
2016-05-17 20:08:55 +02:00
Gwendal Roué
c13ac87a5b
Database.primaryKey(): work around an SQLite bug
2016-05-17 19:40:17 +02:00
Gwendal Roué
d5367fc2b2
Issue #51 : Perform Database.close() in the correct queue
2016-05-17 19:03:07 +02:00
Gwendal Roué
6f779faa05
Documentation
2016-05-17 13:45:39 +02:00
Gwendal Roué
82fa559962
Issue #51 : sqlite3_close_v2() is not available until iOS 8.2 and OS X 10.10. Until then, use sqlite3_close(), and avoid caching statements. Disable the concurrency tests that check database deallocation while some statements are running.
2016-05-17 13:39:29 +02:00
Gwendal Roué
10d20748ad
SQLITE_FULL, SQLITE_IOERR, SQLITE_BUSY, and SQLITE_NOMEM errors can mean that a transaction has been automatically rollbacked: update isInsideTransaction flag accordingly.
2016-05-09 20:52:36 +02:00
Gwendal Roué
fe5ef03bc8
A failed COMMIT is repaired with a ROLLBACK
2016-05-09 20:17:30 +02:00
Gwendal Roué
db86ceca0e
Tests that when Database is deallocated, there is no remaining busy update statement.
2016-05-07 13:18:50 +02:00
Gwendal Roué
a54b0389ae
Remove sharing of cached statements between database pool readers
2016-05-07 13:17:45 +02:00
Gwendal Roué
6c826b6ecf
Statement: don’t store sql string, and use sqlite3_sql instead. Plus some cleanup.
2016-05-07 11:57:35 +02:00
Gwendal Roué
8e864b9df4
Use sqlite3_close_v2, and check its result
2016-05-07 11:37:33 +02:00
Gwendal Roué
b237df4b6d
Use sqlite3_close_v2
2016-05-07 11:34:18 +02:00
Gwendal Roué
fbb59d2d6c
DatabaseReader.backup(to:)
2016-05-05 15:24:14 +02:00
Gwendal Roué
000bd1b200
Database.isInsideTransaction
2016-04-23 09:56:47 +02:00
Gwendal Roué
6550454d1e
Replace DatabaseChanges with Database.lastInsertedRowID and Database.changesCount
2016-04-20 21:58:58 +02:00
Gwendal Roué
1136d367c7
Code organization
2016-04-13 08:59:32 +02:00
Gwendal Roué
30f4744199
Remove dead code
2016-04-08 13:13:21 +02:00
Gwendal Roué
4bcff181c7
Back to block-based database accesses.
...
Rationale: https://medium.com/@gwendal.roue/four-different-ways-to-handle-sqlite-concurrency-db3bcc74d00e
2016-04-08 08:29:58 +02:00
Gwendal Roué
023d757964
Attempt to fix CocoaPods
2016-04-05 08:53:02 +02:00
Gwendal Roué
f868d3eead
changePassphrase()
2016-04-05 05:51:19 +02:00
Gwendal Roué
9f6c5ccccb
Fix availability attributes of localizedCapitalizedString, etc. Restore iOS7 compatibility.
2016-04-03 22:22:06 +02:00
Gwendal Roué
eabacfafb2
Encryption tests
2016-04-03 20:39:20 +02:00
Gwendal Roué
2ec2e85679
Passing tests for encrypted databases
2016-04-03 18:42:31 +02:00