aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backup.go12
-rw-r--r--sqlite3.go8
-rw-r--r--sqlite3_windows.go2
3 files changed, 11 insertions, 11 deletions
diff --git a/backup.go b/backup.go
index 6de4499..2684cc0 100644
--- a/backup.go
+++ b/backup.go
@@ -26,7 +26,11 @@ func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*Backup,
}
func (b *Backup) Step(p int) error {
- return Error{Code: ErrNo(C.sqlite3_backup_step(b.b, C.int(p)))}
+ ret := C.sqlite3_backup_step(b.b, C.int(p))
+ if ret != 0 {
+ return Error{Code: ErrNo(ret)}
+ }
+ return nil
}
func (b *Backup) Remaining() int {
@@ -38,5 +42,9 @@ func (b *Backup) PageCount() int {
}
func (b *Backup) Finish() error {
- return Error{Code: ErrNo(C.sqlite3_backup_finish(b.b))}
+ ret := C.sqlite3_backup_finish(b.b)
+ if ret != 0 {
+ return Error{Code: ErrNo(ret)}
+ }
+ return nil
}
diff --git a/sqlite3.go b/sqlite3.go
index d1cf9c0..3d5110b 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -366,22 +366,14 @@ func (s *SQLiteStmt) bind(args []driver.Value) error {
b := []byte(v)
rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
}
- case int:
- rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
- case int32:
- rv = C.sqlite3_bind_int(s.s, n, C.int(v))
case int64:
rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
- case byte:
- rv = C.sqlite3_bind_int(s.s, n, C.int(v))
case bool:
if bool(v) {
rv = C.sqlite3_bind_int(s.s, n, 1)
} else {
rv = C.sqlite3_bind_int(s.s, n, 0)
}
- case float32:
- rv = C.sqlite3_bind_double(s.s, n, C.double(v))
case float64:
rv = C.sqlite3_bind_double(s.s, n, C.double(v))
case []byte:
diff --git a/sqlite3_windows.go b/sqlite3_windows.go
index 7a52826..e4ebc24 100644
--- a/sqlite3_windows.go
+++ b/sqlite3_windows.go
@@ -2,7 +2,7 @@ package sqlite3
/*
#cgo CFLAGS: -I. -fno-stack-check -fno-stack-protector -mno-stack-arg-probe
-#cgo LDFLAGS: -lmingwex -lmingw32
+#cgo LDFLAGS: -lmingwex -lmingw32 -lmsvcr100
#cgo CFLAGS: -DSQLITE_ENABLE_RTREE
*/
import "C"