     
     // A function declared as rethrows that synchronously executes a throwing
     // block in a dispatch_queue.
-    static func dispatchSync<R>(queue: dispatch_queue_t, block: () throws -> R) rethrows -> R {
-        func dispatchSyncImpl(queue: dispatch_queue_t, block: () throws -> R, block2: (ErrorType) throws -> Void) rethrows -> R {
-            var result: R? = nil
+    static func dispatchSync<T>(queue: dispatch_queue_t, block: () throws -> T) rethrows -> T {
+        func dispatchSyncImpl(queue: dispatch_queue_t, block: () throws -> T, block2: (ErrorType) throws -> Void) rethrows -> T {
+            var result: T? = nil
             var blockError: ErrorType? = nil
             dispatch_sync(queue) {
                 do {

    ///
    /// - parameter block: A block that accesses the database.
    /// - throws: The error thrown by the block.
    public func inDatabase<R>(block: (db: Database) throws -> R) rethrows -> R {
        return try inQueue {
            try block(db: self.database)
        }

    /// Synchronously executes a block in the database queue, wrapped inside a
    /// transaction.
    ///
    /// If the block throws an error, the transaction is rollbacked and the
    /// error is rethrown.
    ///
    ///     try dbQueue.inTransaction { db in
    ///         db.execute(...)
