Commit Graph
95 Commits
Author SHA1 Message Date
Gwendal Roué ead89420c4 Avoid undefined behavior (UnsafePointer documentation is scary) 2018-05-31 17:37:46 +02:00
David Hart d601e06f25 Fix buffer overflow in vsscanf date parsing 2018-05-31 17:07:23 +02:00
Florent Pillet c0bd8ce917 Rolled back to previous NSUUID extension as compiler freaks out on a more modern implementation 2018-05-20 14:37:59 +02:00
Florent Pillet df8887be05 Fix NSUUID compilation issue (now using more Swift code) 2018-05-20 00:27:02 +02:00
Florent Pillet 55472c2d7f Main framework compiles on Linux 2018-05-19 18:52:35 +02:00
Florent Pillet 2de040a6f1 Use String(format: ...)
... instead of `NSString(format: ...) as String`
2018-05-12 15:39:59 +02:00
Gwendal Roué c1c3233ba2 Remove two useless .init (thank you Xcode autocomplete) 2018-05-07 19:23:33 +02:00
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é 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
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é 85d3c584ef Swift 4.1 compatibility (SE-0184 , SE-0187) 2018-03-12 18:20:10 +01:00
Gwendal Roué 247cbdd0d0 Date and NSDate interpret database numbers as unix timestamps. 2017-09-05 08:58:17 +02:00
Gwendal Roué 06a8c8b940 GRDB is now able to store and load zero-length blobs. 2017-09-03 10:09:00 +02:00
Gwendal Roué 2785e69fc1 Data adopts StatementColumnConvertible 2017-08-29 19:27:47 +02:00
Gwendal Roué 8ccc23333d Replace DatabaseCursor with new concrete cursors RowCursor, StatementColumnCursor, NullableStatementColumnCursor, and StatementCursor. 2017-08-23 08:16:30 +02:00
Gwendal Roué c5da564fb3 Use built-in SQLite3 module when available 2017-08-19 15:21:44 +02:00
Gwendal Roué dc75ca4caf SE-0166 2017-08-18 14:22:14 +02:00
Gwendal Roué cfd2d80b78 Fix typo 2017-07-30 15:22:13 +02:00
Gwendal Roué 0eb51e3e8b Int8, Int16, UInt, UInt8, UInt16, UInt32, UInt64 adopt DatabaseValueConvertible and StatementColumnConvertible 2017-07-29 12:58:35 +02:00
Gwendal Roué 60e6c7d250 Remove DatabaseCoder 2017-06-20 07:54:19 +02:00
Gwendal Roué 973f38727d More Xcode-9 fixes 2017-06-09 06:44:26 +02:00
David Hart deaac5808d Make the bug-fix conditional to continue building on 3.1 2017-06-09 06:44:26 +02:00
David Hart 22dc01610e Fix compilation with Xcode 9 in compatibilty mode 2017-06-09 06:44:26 +02:00
Gwendal Roué 10e669423f Use the dbValue identifier for variables of type DatabaseValue 2017-06-01 08:35:14 +02:00
Gwendal Roué 63b3b4225a Rename package to GRDB, and rename SQLite module to CSQLite 2017-04-11 13:22:26 +02:00
Andrey Fidrya 1751fb38e5 SPM support 2017-04-08 21:32:58 +03:00
Gwendal Roué 62d19c9d11 Xcode8.3 WIP 2017-03-28 08:02:08 +02:00