Files
GRDB.swift/TODO.md
T
2017-05-04 18:05:49 +02:00

6.8 KiB

v1.0 checklit

  • Remove RowConvertible.awakeFromFetch()
  • Document or remove DatabaseCoder
  • Check scenarios where cached statements aren't performed with the arguments expected by the user (1. produce a cached statement, with some arguments 2. produce the same cached statement, with different arguments 3. run the first statement (with wrong arguments)). Provide eventual fix.
  • Support joins
  • Request/TypedRequest:
    • Why Request/TypedRequest? What about removing TypedRequest and having a Fetched associated type in Request? We keep TypedRequest because adding an associate Fetched type to Request forces too many APIs to become generic for no real purpose, when one does not use AnyRequest as a concrete type. Besides, not all requests have a naturel Fetched type: request.fetchCount(db) doesn't care about the type of the request, for example.
    • Question AnyRequest and AnyTypedRequest as results (for example, SQLRequest("...").bound(to: MyRecord.self) returns AnyTypedRequest). It's not worth the effort to introduce more concrete request types (AdaptedRequest, AdaptedTypedRequest, BoundRequest)
    • Question the naming of the request.bound(to:T.self) method. Prefer... request.fetching(T.self)? request.of(T.self)?
  • Make GRDB less stringly-typed. When a user defines a static list of columns for a record type, those columns should be easier to use:
    • Persistable.persistentDictionary requires string keys, doesn't accept columns
    • If possible, improve on Person.filter(Person.email != nil) or Person.filter(Person.Column.email != nil) (see #186)
    • Check SE-0166

Not sure

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

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

  • 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
    }
    
  • 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: