 			}
 		}
 		
-		func query(_ query: QueryClosure) throws -> Any? {
+		public func query(_ query: QueryClosure) throws -> Any? {
 			// Acquire re-entrant lock.
 			_databaseLock.lock()
 			

			openConnection()
		}
		
		func beginTransaction() throws {
			if (sqlite3_exec(database, "BEGIN TRANSACTION", nil, nil, nil) != SQLITE_OK) {
				throw Errors.execFailed("Error beginning transaction: \(String(cString: sqlite3_errmsg(database)))")
			}
		}
		
		func commitTransaction() throws {
			if (sqlite3_exec(database, "COMMIT TRANSACTION", nil, nil, nil) != SQLITE_OK) {
				throw Errors.execFailed("Error committing transaction: \(String(cString: sqlite3_errmsg(database)))")
			}
		}
		
		func rollbackTransaction() throws {
			if (sqlite3_exec(database, "ROLLBACK TRANSACTION", nil, nil, nil) != SQLITE_OK) {
				throw Errors.execFailed("Error committing transaction: \(String(cString: sqlite3_errmsg(database)))")
			}
		}
		
		func query<T>(from table: Table<T>, _ query: String, cache: Bool) -> [T] {
			var results: [T]?
			
			do {

		
		// MARK: - Functions
		
		public func openConnection() {
			guard !connected else {
				return
			}
