diff options
author | Rob Ryan <robert.ryan@mindspring.com> | 2015-01-25 08:49:18 +0300 |
---|---|---|
committer | Rob Ryan <robert.ryan@mindspring.com> | 2015-01-25 08:49:18 +0300 |
commit | f0277ac36a5812b2a2b57a1b7fde41f31a921f3b (patch) | |
tree | 807f08258b4ffa48c704c96e889a69df0103256e | |
parent | 70dd7f7ee057a3781049f69ac09b18e15e7bf1be (diff) |
Fix note in executeQuery documentation
-rw-r--r-- | src/fmdb/FMDatabase.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fmdb/FMDatabase.h b/src/fmdb/FMDatabase.h index 9628655..1ddfa79 100644 --- a/src/fmdb/FMDatabase.h +++ b/src/fmdb/FMDatabase.h @@ -473,6 +473,8 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary @see FMResultSet @see [`FMResultSet next`](<[FMResultSet next]>) @see [`sqlite3_bind`](http://sqlite.org/c3ref/bind_blob.html) + + @note If you want to use this from Swift, please note that you must include `FMDatabaseVariadic.swift` in your project. Without that, you cannot use this method directly, and instead have to use methods such as `<executeQuery:withArgumentsInArray:>`. */ - (FMResultSet *)executeQuery:(NSString*)sql, ...; @@ -503,8 +505,6 @@ typedef int(^FMDBExecuteStatementsCallbackBlock)(NSDictionary *resultsDictionary There are two reasons why this distinction is important. First, the printf-style escape sequences can only be used where it is permissible to use a SQLite `?` placeholder. You can use it only for values in SQL statements, but not for table names or column names or any other non-value context. This method also cannot be used in conjunction with `pragma` statements and the like. Second, note the lack of quotation marks in the SQL. The `WHERE` clause was _not_ `WHERE name='%@'` (like you might have to do if you built a SQL statement using `NSString` method `stringWithFormat`), but rather simply `WHERE name=%@`. - @note If you want to use this from Swift, please note that you must include `FMDatabaseVariadic.swift` in your project. Without that, you cannot use this method directly, and instead have to use methods such as `<executeQuery:withArgumentsInArray:>`. - */ - (FMResultSet *)executeQueryWithFormat:(NSString*)format, ... NS_FORMAT_FUNCTION(1,2); |