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
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "SL3Statement.h"
#import "SL3Statement+Private.h"
#import "SL3BindObjectFailedException.h"
#import "SL3ClearBindingsFailedException.h"
#import "SL3ExecuteStatementFailedException.h"
#import "SL3PrepareStatementFailedException.h"
#import "SL3ResetStatementFailedException.h"
static void
releaseObject(void *object)
{
[(id)object release];
}
@implementation SL3Statement
- (instancetype)sl3_initWithConnection: (SL3Connection *)connection
SQLStatement: (OFConstantString *)SQLStatement
{
self = [super init];
@try {
int code = sqlite3_prepare_v2(connection->_db,
|
|
|
|
|
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
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#import "SL3PreparedStatement.h"
#import "SL3PreparedStatement+Private.h"
#import "SL3BindObjectFailedException.h"
#import "SL3ClearBindingsFailedException.h"
#import "SL3ExecuteStatementFailedException.h"
#import "SL3PrepareStatementFailedException.h"
#import "SL3ResetStatementFailedException.h"
static void
releaseObject(void *object)
{
[(id)object release];
}
@implementation SL3PreparedStatement
- (instancetype)sl3_initWithConnection: (SL3Connection *)connection
SQLStatement: (OFConstantString *)SQLStatement
{
self = [super init];
@try {
int code = sqlite3_prepare_v2(connection->_db,
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
sqlite3_finalize(_stmt);
[_connection release];
[super dealloc];
}
static void
bindObject(SL3Statement *statement, int column, id object)
{
int code;
if ([object isKindOfClass: [OFNumber class]]) {
switch (*[object objCType]) {
case 'f':
case 'd':
|
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
sqlite3_finalize(_stmt);
[_connection release];
[super dealloc];
}
static void
bindObject(SL3PreparedStatement *statement, int column, id object)
{
int code;
if ([object isKindOfClass: [OFNumber class]]) {
switch (*[object objCType]) {
case 'f':
case 'd':
|