Files
GRDB.swift/TODO.md
T
2016-12-16 18:45:40 +01:00

6.1 KiB

  • FetchedRecordsController is not reactive:

    We need to be able to start and stop subscribing to changes made on a request. This means that diffs have to be performed between two arbitraty states of the database, not only between two transactions.

    And let's lift the restriction on Record: make this able to work on any fetchable type (row, record, value, optional value).

  • Request.bound(to:adapter:) (requires adapters to be able to adapt an already adapted row)

  • Think about supporting Cursor's underestimatedCount, which could speed up Array(cursor) and fetchAll()

  • FetchedRecordsController: handle fetch errors

  • Swift 3.0.2 (Xcode 8.2): "Type inference will properly unwrap optionals when used with generics and implicitly-unwrapped optionals." Maybe this fixes row.value(named: "foo") as? Int?

  • Attach databases (this could be the support for fetched records controller caches). Interesting question: what happens when one attaches a non-WAL db to a databasePool?

  • SQLCipher: sqlite3_rekey is discouraged (https://github.com/ccgus/fmdb/issues/547#issuecomment-259219320)

  • Restore dispatching tests in GRDBOSXTests (they are disabled in order to avoid linker errors)

    • DatabasePoolReleaseMemoryTests
    • DatabasePoolSchemaCacheTests
    • DatabaseQueueReleaseMemoryTests
    • DatabasePoolBackupTests
    • DatabasePoolConcurrencyTests
    • DatabasePoolReadOnlyTests
    • DatabaseQueueConcurrencyTests
  • FetchedRecordsController throttling (suggested by @hdlj)

  • What is the behavior inTransaction and inSavepoint behaviors in case of commit error? Code looks like we do not rollback, leaving the app in a weird state (out of Swift transaction block with a SQLite transaction that may still be opened).

  • GRDBCipher / custom SQLite builds: remove #/@available limitations

  • File protection: Read https://github.com/ccgus/fmdb/issues/262 and understand https://lists.apple.com/archives/cocoa-dev/2012/Aug/msg00527.html

  • Support for resource values (see https://developer.apple.com/library/ios/qa/qa1719/_index.html)

  • Query builder

Not sure

  • Support for OR ROLLBACK, and mismatch between the Swift depth and the SQLite depth of nested transactions/savepoint:

    try db.inTransaction {           // Swift depth: 1, SQLite depth: 1
        try db.execute("COMMIT")     // Swift depth: 1, SQLite depth: 0
        try db.execute("INSERT ...") // Should throw an error since this statement is no longer protected by a transaction
        try db.execute("SELECT ...") // Should throw an error since this statement is no longer protected by a transaction
        return .commit 
    }
    
    try db.inTransaction {
        try db.execute("INSERT OR ROLLBACK ...") // throws 
        return .commit // not executed because of error
    }   // Should not ROLLBACK since transaction has already been rollbacked
    
    try db.inTransaction {
        do {
            try db.execute("INSERT OR ROLLBACK ...") // throws
        } catch {
        }
        try db.execute("INSERT ...") // Should throw an error since this statement is no longer protected by a transaction
        try db.execute("SELECT ...") // Should throw an error since this statement is no longer protected by a transaction
        return .commit
    }
    
    try db.inTransaction {
        do {
            try db.execute("INSERT OR ROLLBACK ...") // throws
        } catch {
        }
        return .commit  // Should throw an error since transaction has been rollbacked and user's intent can not be applied
    }
    
  • Remove DatabaseValue.value()

    • Don't talk about DatabaseValue.value() in README.md
  • Document or deprecate DatabaseCoder

  • Support for NSColor/UIColor. Beware UIColor components can go beyond [0, 1.0] in iOS10.

  • Store dates as timestamp (https://twitter.com/gloparco/status/780948021613912064, https://github.com/groue/GRDB.swift/issues/97)

Require changes in the Swift language:

Requires recompilation of SQLite:

Reading list: