-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathFMDatabase+InOperator.h
More file actions
46 lines (31 loc) · 2.91 KB
/
FMDatabase+InOperator.h
File metadata and controls
46 lines (31 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// FMDatabase+InOperator.h
// zoziapps.ch
//
// Created by Stefan Pauwels on 06.10.15.
//
#import "FMDatabase.h"
@interface FMDatabase (InOperator)
/**
This method executes a single SQL update statement can handle arrays for MySQL IN-Operators.
The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects as well as `NSArray` for the IN Operator), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
This method replaces all `[?]` with the appropriate number of `?` for the array that was passed, throws all array contents together with the other objects into one array, and calls - (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments
@see - (BOOL)executeUpdate:(NSString *)sql, ...;
@see - (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
@param sql The SQL to be performed, with optional `?` and/or `[?]` placeholders.
@param ... Optional list of parameters to bind to `?` and `[?]` placeholders in the SQL statement. These should be Objective-C objects (e.g. `NSString`, `NSNumber`, etc.) to bind to `?` and `NSArray`to bind to `[?]`, not fundamental C data types (e.g. `int`, `char *`, etc.).
@return `YES` upon success; `NO` upon failure.
*/
- (BOOL)executeUpdateWithInOperator:(NSString *)sql, ...;
/**
This method executes a single SQL select statement can handle arrays for MySQL IN-Operators.
The optional values provided to this method should be objects (e.g. `NSString`, `NSNumber`, `NSNull`, `NSDate`, and `NSData` objects as well as `NSArray` for the IN Operator), not fundamental data types (e.g. `int`, `long`, `NSInteger`, etc.). This method automatically handles the aforementioned object types, and all other object types will be interpreted as text values using the object's `description` method.
This method replaces all `[?]` with the appropriate number of `?` for the array that was passed, throws all array contents together with the other objects into one array, and calls - (BOOL)executeQuery:(NSString*)sql withArgumentsInArray:(NSArray *)arguments
@see - (BOOL)executeUpdate:(NSString *)sql, ...;
@see - (BOOL)executeUpdate:(NSString*)sql withArgumentsInArray:(NSArray *)arguments;
@param sql The SQL to be performed, with optional `?` and/or `[?]` placeholders.
@param ... Optional list of parameters to bind to `?` and `[?]` placeholders in the SQL statement. These should be Objective-C objects (e.g. `NSString`, `NSNumber`, etc.) to bind to `?` and `NSArray`to bind to `[?]`, not fundamental C data types (e.g. `int`, `char *`, etc.).
@return A `<FMResultSet>` for the result set upon success; `nil` upon failure.
*/
- (FMResultSet *)executeQueryWithInOperator:(NSString *)sql, ...;
@end