Commit Graph
1730 Commits
Author SHA1 Message Date
Gwendal Roué 4415681c92 SQLiteDateParser: don't parse garbage into nanoseconds 2018-06-07 08:36:29 +02:00
Gwendal Roué 5a0425a23c SQLiteDateParser: optimize nanoseconds parsing 2018-06-07 08:36:29 +02:00
Gwendal Roué 8729085528 Add a sanity check 2018-06-07 08:36:29 +02:00
Gwendal Roué 88cbbf5c5e Add missing imports (should fix travis issues) 2018-06-07 08:36:29 +02:00
Gwendal Roué 6816bceed0 No need for useScanfStrategy any longer 2018-06-07 08:36:29 +02:00
Gwendal Roué 82482bdbf7 Date adopts StatementColumnConvertible 2018-06-07 08:36:29 +02:00
Gwendal Roué 062f916607 Documentation 2018-06-07 08:36:29 +02:00
Gwendal Roué 2b73c4f348 Check useScanfStrategy in DatabaseDateComponents.init(sqliteStatement:index:)
...so that we can eventually compare gains
2018-06-07 08:36:29 +02:00
Gwendal Roué 54b2135b74 DatabaseDateComponents adopts StatementColumnConvertible
We'll need benchmarks to evaluate the gain, here
2018-06-07 08:36:29 +02:00
Gwendal Roué bf3b4e7e02 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-06-07 08:36:29 +02:00
Gwendal Roué ad8b80bafd (whitespace) 2018-06-07 08:36:29 +02:00
Gwendal Roué 06476bc6fe SQLiteDateParser.components(from:) is not public 2018-06-07 08:36:29 +02:00
Gwendal Roué 0616209e58 SQLiteDateParser: no more static methods 2018-06-07 08:36:29 +02:00
Gwendal Roué 415f2971e5 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-06-07 08:36:29 +02:00
Gwendal Roué 3a7b2cc4a2 SQLiteDateParser: get rid of the mutex 2018-06-07 08:36:29 +02:00
Matt Greenfield 63a68978f0 truncate nanosecond precision to 3 sig figs 2018-06-07 08:36:29 +02:00
Matt Greenfield 36ac5fa53e truncate date/time strings that include seconds precision beyond the nanosecond scale 2018-06-07 08:36:29 +02:00
Matt Greenfield 70190e2a23 not all nanosecond fractions have 3 sig figs, so can't hard code the acceptable string lengths 2018-06-07 08:36:29 +02:00
Matt Greenfield 2682dae34b 0.123 is not the same thing as 0.000123 2018-06-07 08:36:29 +02:00
Matt Greenfield 3a1e695a39 fractions of seconds are not the same thing as integer counts of nanoseconds 2018-06-07 08:36:29 +02:00
Matt Greenfield 604f80f6fa differentiate between SS and SS.SSS formats 2018-06-07 08:36:29 +02:00
Matt Greenfield 5c0b88eb82 return correct Format for partial date/time combinations 2018-06-07 08:36:29 +02:00
Matt Greenfield 815424770b initial scanf() based date string parser 2018-06-07 08:36:29 +02:00
Gwendal Roué 1cbe60a13f Better checks for Swift < 4.1 (thanks @hartbit!) 2018-03-12 18:33:06 +01:00
Gwendal Roué bca1fe0d9b SE-0184: backport UnsafeMutablePointer.deallocate() 2018-03-12 18:20:10 +01:00
Gwendal Roué a75e519294 SE-0185: let Swift 4.1 generate as much Equatable and Hashable conformance as possible 2018-03-12 18:20:10 +01:00
Gwendal Roué 75d5c2a39f SE-0187: deprecate Cursor.flatMap in favor of Cursor.compactMap 2018-03-12 18:20:10 +01:00
Gwendal Roué 85d3c584ef Swift 4.1 compatibility (SE-0184 , SE-0187) 2018-03-12 18:20:10 +01:00
Gwendal Roué dbfbe30749 DatabaseSnapshot RAII 2018-02-24 17:15:53 +01:00
Gwendal Roué 9168bac16e Deprecate RecordBox. Introduce changes API on MutablePersistable. Rename Record changes tracking methods. 2018-02-24 16:19:21 +01:00
Gwendal Roué 5e4406e78c Improves documentation (addresses #306) 2018-02-24 07:54:42 +01:00
Gwendal Roué 76561a567f Introduce DatabaseSnapshot 2018-02-24 07:37:26 +01:00
Gwendal Roué 7dc008db8b Expose Database.beginTransaction(), commit(), rollback(). New Configuration.allowsUnsafeTransactions flag. New fatal error when a database access block ends with a transaction left opened. 2018-02-23 14:14:05 +01:00
Gwendal Roué f2d9f50930 CHANGELOG 2018-02-23 13:10:40 +01:00
Gwendal Roué b9af7e6a25 Update ColumnInfo.primaryKeyIndex documentation 2018-02-23 12:55:27 +01:00
Gwendal Roué aa1f555e05 Drop init(leftJoinedRow:), and expose Row subscripts that return records 2018-02-23 08:08:00 +01:00
Gwendal Roué 79ed15c38c Deprecate Database.columnCount(in:) in favor of Database.columns(in:). Update doc and changelog 2018-02-22 14:00:19 +01:00
Gwendal Roué ae3319e9f9 Make ColumnInfo public (asked by @freak4pc) 2018-02-22 13:20:41 +01:00
Gwendal Roué 5112cb24f5 Expose EmptyRowAdapter, and ScopeAdapter(base:scopes:) 2018-02-22 12:38:03 +01:00
Gwendal Roué c6bbccc02e Have AdaptedRow go straight to SQLite when possible (avoid DatabaseValue initializer) 2018-02-22 12:23:19 +01:00
Gwendal Roué 93ec4d2515 Remove Row.hasNull(named:String) and Row.hasNull(Column) 2018-02-22 12:00:06 +01:00
Gwendal Roué bd694cbc53 Cleanup 2018-02-22 08:50:35 +01:00
Gwendal Roué c115a035ec Row.hasNull(atIndex:) goes straight to sqlite3_column_type() when possible 2018-02-22 08:39:14 +01:00
Gwendal Roué 288144f347 splittingRowAdapters(columnCounts:), ScopeAdapter(nestedScopes:), RowConvertible?(leftJoinedRow:), TableMapping.numberOfSelectedColumns(_:), support for nested codable records 2018-02-21 23:15:13 +01:00
Gwendal Roué 3bdfdaa40a TableMapping.selectionSQL(_:) 2018-02-21 13:51:37 +01:00
Gwendal Roué 22949813af Row.hasNull(atIndex:), Row.hasNull(named:), Row.hasNull(_:), Row.hasNonNullValue 2018-02-20 14:43:06 +01:00
Gwendal Roué feb5cb35b4 Record.updateChanges now returns whether the record had changes 2018-02-20 13:06:58 +01:00
Gwendal Roué fcfa044320 Parts of Cursor implementation are derived from Swift.org 2018-01-28 18:56:40 +01:00
Gwendal Roué f95658e7ce Remove convenience cursor types from reference documentation
Those types bloat the documentation for no real value: DropFirstCursor, DropWhileCursor, EnumeratedCursor, FilterCursor, FlattenCursor, MapCursor, PrefixCursor, PrefixWhileCursor
2018-01-28 17:13:53 +01:00
Gwendal Roué 2c16fcaa99 Cursor cleanup 2018-01-28 17:13:52 +01:00