ADDED Doxyfile Index: Doxyfile ================================================================== --- /dev/null +++ Doxyfile @@ -0,0 +1,19 @@ +PROJECT_NAME = "ObjSQLite3" +OUTPUT_DIRECTORY = docs/ +INPUT = src src/exceptions +FILE_PATTERNS = *.h *.m +HTML_OUTPUT = . +HAVE_DOT = NO +GENERATE_LATEX = NO +HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_MEMBERS = YES +TYPEDEF_HIDES_STRUCT = YES +PREDEFINED = _Nullable= \ + OF_DESIGNATED_INITIALIZER= \ + OF_HAVE_BLOCKS \ + OF_GENERIC(...)= \ + OF_NULLABLE_PROPERTY(...)= +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +IGNORE_PREFIX = SL3 +EXTRACT_STATIC = yes Index: src/SL3Connection.h ================================================================== --- src/SL3Connection.h +++ src/SL3Connection.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -22,27 +22,93 @@ #import "SL3PreparedStatement.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3Connection SL3Connection.h ObjSQLite3/ObjSQLite3.h + * + * @brief A connection to a database. + */ @interface SL3Connection: OFObject { #ifdef SL3_PUBLIC_IVARS @public #endif sqlite3 *_conn; } +/** + * @brief Creates a new connection to the database at the specified path. + * + * @param path The path to the database + * @return A new database connection + * @throw SL3OpenFailedException The database could not be opened + */ + (instancetype)connectionWithPath: (OFString *)path; + +/** + * @brief Creates a new connection to the database at the specified path. + * + * @param path The path to the database + * @param flags The flags to open the database with + * @return A new database connection + * @throw SL3OpenFailedException The database could not be opened + */ + (instancetype)connectionWithPath: (OFString *)path flags: (int)flags; + +/** + * @brief Initializes an already allocated connection to connect to the + * database at the specified path. + * + * @param path The path to the database + * @return An initialized connection to the specified database + * @throw SL3OpenFailedException The database could not be opened + */ - (instancetype)initWithPath: (OFString *)path; + +/** + * @brief Initializes an already allocated connection to connect to the + * database at the specified path. + * + * @param path The path to the database + * @param flags The flags to open the database with + * @return An initialized connection to the specified database + * @throw SL3OpenFailedException The database could not be opened + */ - (instancetype)initWithPath: (OFString *)path flags: (int)flags OF_DESIGNATED_INITIALIZER; -- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQL; -- (void)executeStatement: (OFConstantString *)SQL; + +/** + * @brief Prepares the specified SQL statement for the connection and returns + * it. + * + * @param SQLStatement An SQL statement to prepare + * @return A prepared statement + * @throw SL3PrepareStatementFailedException The statement could not be prepared + */ +- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQLStatement; + +/** + * @brief Executes the specified statement without results. + * + * @param SQLStatement The SQL statement to execute + * @throw SL3ExecuteStatementFailedException The statement could not be executed + */ +- (void)executeStatement: (OFConstantString *)SQLStatement; + #ifdef OF_HAVE_BLOCKS +/** + * @brief Executes the specified block in an transaction. + * + * Before the block is executed, a transaction is started. If the block returns + * true, the transaction is committed. If the block returns true or throws an + * exception, the transaction is rolled back. + * + * @param block The block to execute in a transaction + */ - (void)transactionWithBlock: (bool (^)(void))block; #endif @end OF_ASSUME_NONNULL_END Index: src/SL3Connection.m ================================================================== --- src/SL3Connection.m +++ src/SL3Connection.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -68,20 +68,21 @@ sqlite3_close(_conn); [super dealloc]; } -- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQL +- (SL3PreparedStatement *)prepareStatement: (OFConstantString *)SQLStatement { return [[[SL3PreparedStatement alloc] sl3_initWithConnection: self - SQLStatement: SQL] autorelease]; + SQLStatement: SQLStatement] autorelease]; } -- (void)executeStatement: (OFConstantString *)SQL +- (void)executeStatement: (OFConstantString *)SQLStatement { - int code = sqlite3_exec(_conn, SQL.UTF8String, NULL, NULL, NULL); + int code = + sqlite3_exec(_conn, SQLStatement.UTF8String, NULL, NULL, NULL); if (code != SQLITE_OK) @throw [SL3ExecuteStatementFailedException exceptionWithConnection: self errorCode: code]; Index: src/SL3PreparedStatement.h ================================================================== --- src/SL3PreparedStatement.h +++ src/SL3PreparedStatement.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -22,30 +22,90 @@ OF_ASSUME_NONNULL_BEGIN @class SL3Connection; +/** + * @class SL3PreparedStatement SL3PreparedStatement.h ObjSQLite3/ObjSQLite3.h + * + * @brief A prepared statement. + */ @interface SL3PreparedStatement: OFObject { #ifdef SL3_PUBLIC_IVARS @public #endif SL3Connection *_connection; sqlite3_stmt *_stmt; } -@property (readonly, nonatomic) OFArray *rowArray; +/** + * @brief The current row as an array. + */ +@property (readonly, nonatomic) OFArray *currentRowArray; + +/** + * @brief The current row as a dictionary. + */ @property (readonly, nonatomic) - OFDictionary OF_GENERIC(OFString *, id) *rowDictionary; + OFDictionary OF_GENERIC(OFString *, id) *currentRowDictionary; +/** + * @brief Binds the objects from the specified array. + * + * @param array An array of objects to bind + * @throw OFOutOfRangeException The array has more objects than columns + */ - (void)bindWithArray: (OFArray *)array; + +/** + * @brief Binds the objects from the specified dictionary that maps each column + * name to a value. + * + * @param dictionary A map of column names to values + * @throw OFUndefinedKeyException A column name which does not exist was + * specified + */ - (void)bindWithDictionary: (OFDictionary OF_GENERIC(OFString *, id) *)dictionary; + +/** + * @brief Clears all bindings. + * + * @throw SL3ClearBindingsFailedException The bindings could not be cleared + */ - (void)clearBindings; + +/** + * @brief Steps the prepared statement, returning the next row, if any. + * + * @return Whether there was another row + * @throw SL3ExecuteStatementFailedException Executing the prepared statement + * failed + */ - (bool)step; -- (id)objectForColumn: (size_t)column; + +/** + * @brief Returns the object for the specified column of the current row. + */ +- (id)objectForCurrentRowAtColumn: (size_t)column; + +/** + * @brief The number of columns. + */ - (size_t)columnCount; + +/** + * @brief Returns the name for the specified column. + */ - (OFString *)nameForColumn: (size_t)column; + +/** + * @brief Resets the prepared statement. + * + * @throw SL3ResetStatementFailedException The prepared statement could not be + * reset + */ - (void)reset; @end OF_ASSUME_NONNULL_END Index: src/SL3PreparedStatement.m ================================================================== --- src/SL3PreparedStatement.m +++ src/SL3PreparedStatement.m @@ -170,11 +170,11 @@ errorCode: code]; return (code == SQLITE_ROW); } -- (id)objectForColumn: (size_t)column +- (id)objectForCurrentRowAtColumn: (size_t)column { if (column > INT_MAX) @throw [OFOutOfRangeException exception]; switch (sqlite3_column_type(_stmt, column)) { @@ -214,31 +214,31 @@ @throw [OFOutOfMemoryException exception]; return [OFString stringWithUTF8String: name]; } -- (OFArray *)rowArray +- (OFArray *)currentRowArray { size_t count = [self columnCount]; OFMutableArray *array = [OFMutableArray arrayWithCapacity: count]; for (size_t i = 0; i < count; i++) - [array addObject: [self objectForColumn: i]]; + [array addObject: [self objectForCurrentRowAtColumn: i]]; [array makeImmutable]; return array; } -- (OFDictionary OF_GENERIC(OFString *, id) *)rowDictionary +- (OFDictionary OF_GENERIC(OFString *, id) *)currentRowDictionary { size_t count = [self columnCount]; OFMutableDictionary *dictionary = [OFMutableDictionary dictionaryWithCapacity: count]; for (size_t i = 0; i < count; i++) - [dictionary setObject: [self objectForColumn: i] + [dictionary setObject: [self objectForCurrentRowAtColumn: i] forKey: [self nameForColumn: i]]; [dictionary makeImmutable]; return dictionary; Index: src/exceptions/SL3BindObjectFailedException.h ================================================================== --- src/exceptions/SL3BindObjectFailedException.h +++ src/exceptions/SL3BindObjectFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,31 +20,73 @@ #import "SL3PreparedStatement.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3BindObjectFailedException SL3BindObjectFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @brief An exception indicating that binding an object to a prepared + * statement failed. + */ @interface SL3BindObjectFailedException: SL3Exception { id _object; int _column; SL3PreparedStatement *_statement; } +/** + * @brief The object that could not be bound to a prepared statement. + */ @property (readonly, nonatomic) id object; + +/** + * @brief The column of the prepared statement to which the object could not be + * bound. + */ @property (readonly, nonatomic) int column; + +/** + * @brief The statement to which the object could not be bound. + */ @property (readonly, nonatomic) SL3PreparedStatement *statement; + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Creates an new bind object failed exception. + * + * @param object The object that could not be bound to a prepared statement + * @param column The column of the prepared statement to which the object could + * not be bound + * @param statement The statement to which the object could not be bound + * @param errorCode The SQLite3 error code + * @return A new, autoreleased bind object failed exception + */ + (instancetype)exceptionWithObject: (id)object column: (int)column statement: (SL3PreparedStatement *)statement errorCode: (int)errorCode; + - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated bind object failed exception. + * + * @param object The object that could not be bound to a prepared statement + * @param column The column of the prepared statement to which the object could + * not be bound + * @param statement The statement to which the object could not be bound + * @param errorCode The SQLite3 error code + * @return An initialized bind object failed exception + */ - (instancetype)initWithObject: (id)object column: (int)column statement: (SL3PreparedStatement *)statement errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3ClearBindingsFailedException.h ================================================================== --- src/exceptions/SL3ClearBindingsFailedException.h +++ src/exceptions/SL3ClearBindingsFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,23 +20,49 @@ #import "SL3PreparedStatement.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3ClearBindingsFailedException SL3ClearBindingsFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @brief An exception indicating that clearing a statement's bindings failed. + */ @interface SL3ClearBindingsFailedException: SL3Exception { SL3PreparedStatement *_statement; } +/** + * @brief The statement whose bindings could not be cleared. + */ @property (readonly, nonatomic) SL3PreparedStatement *statement; + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Creates a new clear bindings failed exception. + * + * @param statement The statement whose bindings could not be cleared + * @param errorCode The SQLite3 error code + * @return A new, autoreleased clear bindings failed exception + */ + (instancetype)exceptionWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode; + - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated clear bindings failed exception. + * + * @param statement The statement whose bindings could not be cleared + * @param errorCode The SQLite3 error code + * @return An initialized clear bindings failed exception + */ - (instancetype)initWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3Exception.h ================================================================== --- src/exceptions/SL3Exception.h +++ src/exceptions/SL3Exception.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,23 +20,52 @@ #import "SL3Connection.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3Exception SL3Exception.h ObjSQLite3/ObjSQLite3.h + * + * @brief An SQLite3 exception. + */ @interface SL3Exception: OFException { - SL3Connection *_connection; + SL3Connection *_Nullable _connection; int _errorCode; } +/** + * @brief The connection for which the exception occurred. + */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) SL3Connection *connection; + +/** + * @brief The SQLite3 error code. + */ @property (readonly, nonatomic) int errorCode; + (instancetype)exception OF_UNAVAILABLE; + +/** + * @brief Creates a new SQLite3 exception. + * + * @param connection The connection for which the exception occurred. + * @param errorCode The SQLite3 error code. + * @return A new, autoreleased SQLite3 exception + */ + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode; + - (instancetype)init OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated SQLite3 exception. + * + * @param connection The connection for which the exception occurred. + * @param errorCode The SQLite3 error code. + * @return An initialized SQLite3 exception + */ - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3ExecuteStatementFailedException.h ================================================================== --- src/exceptions/SL3ExecuteStatementFailedException.h +++ src/exceptions/SL3ExecuteStatementFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,19 +20,46 @@ #import "SL3PreparedStatement.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3ExecuteStatementFailedException + * SL3ExecuteStatementFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @brief An exception indicating that executing a statement failed. + */ @interface SL3ExecuteStatementFailedException: SL3Exception { - SL3PreparedStatement *_statement; + SL3PreparedStatement *_Nullable _statement; } -@property (readonly, nonatomic) SL3PreparedStatement *statement; +/** + * @brief The statement that could not be executed. + */ +@property OF_NULLABLE_PROPERTY (readonly, nonatomic) + SL3PreparedStatement *statement; +/** + * @brief Creates a new execute statement failed exception. + * + * @param statement The statement that could not be executed + * @param errorCode The SQLite3 error code + * @return A new, autoreleased execute statement exception failed. + */ + (instancetype)exceptionWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode; + +/** + * @brief Initializes an an already allocated execute statement failed + * exception. + * + * @param statement The statement that could not be executed + * @param errorCode The SQLite3 error code + * @return An initialized execute statement exception failed. + */ - (instancetype)initWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3OpenFailedException.h ================================================================== --- src/exceptions/SL3OpenFailedException.h +++ src/exceptions/SL3OpenFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,27 +18,59 @@ #import "SL3Exception.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3OpenFailedException SL3OpenFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @brief An exception indicating that a database could not be opened. + */ @interface SL3OpenFailedException: SL3Exception { OFString *_path; int _flags; } +/** + * @brief The path of the database that could not be opened. + */ @property (readonly, nonatomic) OFString *path; + +/** + * @brief The flags with which the database could not be opened. + */ @property (readonly, nonatomic) int flags; + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Creates a new open failed exception. + * + * @param path The path of the database that could not be opened + * @param flags The flags with which the database could not be opened + * @param errorCode The SQLite3 error code + * @return A new, autoreleased open failed exception + */ + (instancetype)exceptionWithPath: (OFString *)path flags: (int)flags errorCode: (int)errorCode; + - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated open failed exception. + * + * @param path The path of the database that could not be opened + * @param flags The flags with which the database could not be opened + * @param errorCode The SQLite3 error code + * @return An initialized open failed exception + */ - (instancetype)initWithPath: (OFString *)path flags: (int)flags errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3PrepareStatementFailedException.h ================================================================== --- src/exceptions/SL3PrepareStatementFailedException.h +++ src/exceptions/SL3PrepareStatementFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -18,25 +18,56 @@ #import "SL3Exception.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3PrepareStatementFailedException + * SL3PrepareStatementFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @brief An exception indicating that preparing a statement failed. + */ @interface SL3PrepareStatementFailedException: SL3Exception { OFConstantString *_SQLStatement; } +/** + * @brief The SQL statement which could not be prepared. + */ @property (readonly, nonatomic) OFConstantString *SQLStatement; + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Creates a new prepare statement failed exception. + * + * @param connection The connection for which the statement could not be + * prepared + * @param SQLStatement The SQL statement which could not be prepared + * @param errorCode The SQLite3 error code + * @return A new, autoreleased prepare statement failed exception + */ + (instancetype)exceptionWithConnection: (SL3Connection *)connection SQLStatement: (OFConstantString *)SQLStatement errorCode: (int)errorCode; + - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated prepare statement failed exception. + * + * @param connection The connection for which the statement could not be + * prepared + * @param SQLStatement The SQL statement which could not be prepared + * @param errorCode The SQLite3 error code + * @return An initialized prepare statement failed exception + */ - (instancetype)initWithConnection: (SL3Connection *)connection SQLStatement: (OFConstantString *)SQLStatement errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: src/exceptions/SL3ResetStatementFailedException.h ================================================================== --- src/exceptions/SL3ResetStatementFailedException.h +++ src/exceptions/SL3ResetStatementFailedException.h @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020 Jonathan Schleifer + * Copyright (c) 2020, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,23 +20,49 @@ #import "SL3PreparedStatement.h" OF_ASSUME_NONNULL_BEGIN +/** + * @class SL3ResetStatementFailedException SL3ResetStatementFailedException.h + * ObjSQLite3/ObjSQLite3.h + * + * @param An exception indicating that resetting a statement failed. + */ @interface SL3ResetStatementFailedException: SL3Exception { SL3PreparedStatement *_statement; } +/** + * @brief The statement that could not be reset. + */ @property (readonly, nonatomic) SL3PreparedStatement *statement; + (instancetype)exceptionWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Creates a new reset statement failed exception. + * + * @param statement The statement that could not be reset + * @param errorCode The SQLite3 error code + * @return A new, autoreleased reset statement failed exception. + */ + (instancetype)exceptionWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode; + - (instancetype)initWithConnection: (nullable SL3Connection *)connection errorCode: (int)errorCode OF_UNAVAILABLE; + +/** + * @brief Initializes an already allocated reset statement failed exception. + * + * @param statement The statement that could not be reset + * @param errorCode The SQLite3 error code + * @return An initialized reset statement failed exception. + */ - (instancetype)initWithStatement: (SL3PreparedStatement *)statement errorCode: (int)errorCode OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END Index: tests/Tests.m ================================================================== --- tests/Tests.m +++ tests/Tests.m @@ -1,7 +1,7 @@ /* - * Copyright (c) 2020, 2021, 2023 Jonathan Schleifer + * Copyright (c) 2020, 2021, 2023, 2024 Jonathan Schleifer * * https://fl.nil.im/objsqlite3 * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -85,19 +85,19 @@ break; default: OFEnsure(0); } - OFEnsure([[stmt objectForColumn: 0] isEqual: a]); - OFEnsure([[stmt objectForColumn: 1] isEqual: b]); - OFEnsure([[stmt objectForColumn: 2] isEqual: c]); + OFEnsure([[stmt objectForCurrentRowAtColumn: 0] isEqual: a]); + OFEnsure([[stmt objectForCurrentRowAtColumn: 1] isEqual: b]); + OFEnsure([[stmt objectForCurrentRowAtColumn: 2] isEqual: c]); - OFEnsure([[stmt rowArray] isEqual: ([OFArray arrayWithObjects: - a, b, c, nil])]); - OFEnsure([[stmt rowDictionary] isEqual: + OFEnsure([[stmt currentRowArray] isEqual: + ([OFArray arrayWithObjects: a, b, c, nil])]); + OFEnsure([[stmt currentRowDictionary] isEqual: ([OFDictionary dictionaryWithKeysAndObjects: @"a", a, @"b", b, @"c", c, nil])]); } [OFApplication terminate]; } @end