Commit Graph
989 Commits
Author SHA1 Message Date
Gwendal Roué 4e57bf5a0e Fix a youth error: DatabaseDateComponents initializer from DateComponents is no longer failable 2018-04-21 15:27:21 +02:00
Gwendal Roué 223d0a3fd3 Merge remote-tracking branch 'origin/development' into GRDB3 2018-04-21 15:20:36 +02:00
Gwendal Roué 6c5d6ba631 SQLiteDateParser: tighten vsscanf format 2018-04-21 10:37:03 +02:00
Gwendal Roué 1311f6c87c SQLiteDateParser: fix nanosecond parsing 2018-04-21 10:17:07 +02:00
Gwendal Roué 632bce5521 SQLiteDateParser: don't parse garbage into nanoseconds 2018-04-20 19:41:34 +02:00
Gwendal Roué 316d28746b SQLiteDateParser: optimize nanoseconds parsing 2018-04-20 19:26:42 +02:00
Gwendal Roué 9efe4a6efa Add a sanity check 2018-04-20 19:18:46 +02:00
Gwendal Roué 85fbf64068 Add missing imports (should fix travis issues) 2018-04-20 19:17:24 +02:00
Gwendal Roué 282255b841 No need for useScanfStrategy any longer 2018-04-20 19:14:58 +02:00
Gwendal Roué 266040747e Date adopts StatementColumnConvertible 2018-04-20 18:42:12 +02:00
Gwendal Roué 11a4a6acbd Documentation 2018-04-20 18:41:58 +02:00
Gwendal Roué c70689fe54 Check useScanfStrategy in DatabaseDateComponents.init(sqliteStatement:index:)
...so that we can eventually compare gains
2018-04-20 18:34:19 +02:00
Gwendal Roué 936b31f1f0 DatabaseDateComponents adopts StatementColumnConvertible
We'll need benchmarks to evaluate the gain, here
2018-04-20 14:04:12 +02:00
Gwendal Roué 8915672ce5 SQLiteDateParser: parse C strings
Since the goal of this PR is efficiency, we'll soon parse Date and
DatabaseDateComponents right from raw SQLite buffers.
2018-04-20 13:51:20 +02:00
Gwendal Roué 0640f90fc1 (whitespace) 2018-04-20 13:32:50 +02:00
Gwendal Roué d1a0e8d906 SQLiteDateParser.components(from:) is not public 2018-04-20 13:31:57 +02:00
Gwendal Roué e9a668ca56 SQLiteDateParser: no more static methods 2018-04-20 13:31:35 +02:00
Gwendal Roué 27194c802d SQLiteDateParser: use withUnsafeMutablePointer instead of allocations
OK, not really: the nanosecond components remains in the heap.
But we may find a way to put 11 chars on the stack.
2018-04-20 13:30:26 +02:00
Gwendal Roué 7aabfeaeac SQLiteDateParser: get rid of the mutex 2018-04-20 13:09:22 +02:00
Gwendal Roué e45642b6c1 Cleanup 2018-04-19 21:48:12 +02:00
Gwendal Roué b550e2bfd5 Cleanup 2018-04-19 21:45:40 +02:00
Gwendal Roué 4b3854d05d Finally, the meat: perform breadth-first search in let record = row[key], and in FetchableRecord & Decodable 2018-04-19 20:46:58 +02:00
Gwendal Roué 0362ae76ea Rename Row.Scopes to Row.ScopesView. Move breadth-first lookup to a new view, row.scopesTree, of type Row.ScopesTreeView 2018-04-19 20:29:11 +02:00
Gwendal Roué 098c11baf2 Row.Scopes.lookup(_:) performs a breadth-first lookup of a scope name 2018-04-19 19:50:43 +02:00
Gwendal Roué 4e659c550e Rename RowScopes to Row.Scopes. Harmonize row derivation. 2018-04-19 19:18:02 +02:00
Gwendal Roué 9cb1bac2fc Update documentation for scoped rows 2018-04-19 14:46:23 +02:00
Gwendal Roué 7e260cf537 Update tests for new Row.scopes view 2018-04-19 14:41:49 +02:00
Gwendal Roué 57932235ba Introduce RowScopes collection, a view of a row's scopes 2018-04-19 09:07:16 +02:00
Gwendal Roué 9a6daedd6d Cleanup 2018-04-18 07:31:11 +02:00
Matt Greenfield 3b546dedd8 truncate nanosecond precision to 3 sig figs 2018-04-17 15:17:09 +07:00
Matt Greenfield 33066133fc truncate date/time strings that include seconds precision beyond the nanosecond scale 2018-04-17 14:32:33 +07:00
Matt Greenfield dad163771f not all nanosecond fractions have 3 sig figs, so can't hard code the acceptable string lengths 2018-04-17 12:38:23 +07:00
Matt Greenfield bb59f5e6f7 0.123 is not the same thing as 0.000123 2018-04-17 11:05:47 +07:00
Matt Greenfield 7a1aa88edb fractions of seconds are not the same thing as integer counts of nanoseconds 2018-04-16 19:18:49 +07:00
Matt Greenfield b444d376f4 differentiate between SS and SS.SSS formats 2018-04-16 17:39:41 +07:00
Matt Greenfield 59d7909f50 return correct Format for partial date/time combinations 2018-04-16 17:21:00 +07:00
Matt Greenfield 362c4baeca initial scanf() based date string parser 2018-04-16 14:02:15 +07:00
Gwendal Roué d39f02113c Restore T.fetchXXX(db, request) APIs which were removed in PR #311 2018-04-16 08:50:55 +02:00
Gwendal Roué c9dc1223dd Harmonize dbQueue.writer with dbPool.writer 2018-04-15 20:14:25 +02:00
Gwendal Roué 090f872e80 Update documentation: don't mention dbQueue.inDatabase unless necessary 2018-04-15 18:09:34 +02:00
Gwendal Roué a46505e907 Cleanup 2018-04-15 14:30:12 +02:00
Gwendal Roué d78479e4af [WIP] DatabaseQueue.inDatabase runs inside a transaction 2018-04-13 08:56:03 +02:00
Gwendal Roué bd2f17ee10 Fixes needed by DatabasePool/Writer.writeWithoutTransaction 2018-04-12 07:58:01 +02:00
Gwendal Roué 563a4d5c71 Introduce DatabaseWriter.writeWithoutTransaction 2018-04-11 20:03:18 +02:00
Gwendal Roué 78e6241d16 DatabaseWriter.write now guarantees that eventual concurrent readers don't see any changes until all changes are executed. DatabasePool.write thus wraps changes in a transaction. 2018-04-11 20:03:18 +02:00
Gwendal Roué 26912e746b Update documentation for new Row description format 2018-04-11 15:49:16 +02:00
Gwendal Roué fa68b62be1 Improve Row.description & Row.debugDescription 2018-04-11 13:39:44 +02:00
Gwendal Roué 07a1d4d1b8 Database.rollback: add missing dispatch queue check 2018-04-11 13:21:56 +02:00
Gwendal Roué 9c6b48980c Database.isInsideTransaction: add missing dispatch queue check 2018-04-11 13:18:34 +02:00
Gwendal Roué 79c7dd03a5 [Whitespace] 2018-04-11 13:10:15 +02:00