@@ -35,10 +35,10 @@ import (
35
35
const i64 = unsafe .Sizeof (int (0 )) > 4
36
36
37
37
type ZeroBlobLength int32
38
- type Context C.sqlite3_context
38
+ type SQLiteContext C.sqlite3_context
39
39
40
40
// ResultBool sets the result of an SQL function.
41
- func (c * Context ) ResultBool (b bool ) {
41
+ func (c * SQLiteContext ) ResultBool (b bool ) {
42
42
if b {
43
43
c .ResultInt (1 )
44
44
} else {
@@ -48,7 +48,7 @@ func (c *Context) ResultBool(b bool) {
48
48
49
49
// ResultBlob sets the result of an SQL function.
50
50
// See: sqlite3_result_blob, http://sqlite.org/c3ref/result_blob.html
51
- func (c * Context ) ResultBlob (b []byte ) {
51
+ func (c * SQLiteContext ) ResultBlob (b []byte ) {
52
52
if i64 && len (b ) > math .MaxInt32 {
53
53
C .sqlite3_result_error_toobig ((* C .sqlite3_context )(c ))
54
54
return
@@ -62,13 +62,13 @@ func (c *Context) ResultBlob(b []byte) {
62
62
63
63
// ResultDouble sets the result of an SQL function.
64
64
// See: sqlite3_result_double, http://sqlite.org/c3ref/result_blob.html
65
- func (c * Context ) ResultDouble (d float64 ) {
65
+ func (c * SQLiteContext ) ResultDouble (d float64 ) {
66
66
C .sqlite3_result_double ((* C .sqlite3_context )(c ), C .double (d ))
67
67
}
68
68
69
69
// ResultInt sets the result of an SQL function.
70
70
// See: sqlite3_result_int, http://sqlite.org/c3ref/result_blob.html
71
- func (c * Context ) ResultInt (i int ) {
71
+ func (c * SQLiteContext ) ResultInt (i int ) {
72
72
if i64 && (i > math .MaxInt32 || i < math .MinInt32 ) {
73
73
C .sqlite3_result_int64 ((* C .sqlite3_context )(c ), C .sqlite3_int64 (i ))
74
74
} else {
@@ -78,26 +78,26 @@ func (c *Context) ResultInt(i int) {
78
78
79
79
// ResultInt64 sets the result of an SQL function.
80
80
// See: sqlite3_result_int64, http://sqlite.org/c3ref/result_blob.html
81
- func (c * Context ) ResultInt64 (i int64 ) {
81
+ func (c * SQLiteContext ) ResultInt64 (i int64 ) {
82
82
C .sqlite3_result_int64 ((* C .sqlite3_context )(c ), C .sqlite3_int64 (i ))
83
83
}
84
84
85
85
// ResultNull sets the result of an SQL function.
86
86
// See: sqlite3_result_null, http://sqlite.org/c3ref/result_blob.html
87
- func (c * Context ) ResultNull () {
87
+ func (c * SQLiteContext ) ResultNull () {
88
88
C .sqlite3_result_null ((* C .sqlite3_context )(c ))
89
89
}
90
90
91
91
// ResultText sets the result of an SQL function.
92
92
// See: sqlite3_result_text, http://sqlite.org/c3ref/result_blob.html
93
- func (c * Context ) ResultText (s string ) {
93
+ func (c * SQLiteContext ) ResultText (s string ) {
94
94
h := (* reflect .StringHeader )(unsafe .Pointer (& s ))
95
95
cs , l := (* C .char )(unsafe .Pointer (h .Data )), C .int (h .Len )
96
96
C .my_result_text ((* C .sqlite3_context )(c ), cs , l )
97
97
}
98
98
99
99
// ResultZeroblob sets the result of an SQL function.
100
100
// See: sqlite3_result_zeroblob, http://sqlite.org/c3ref/result_blob.html
101
- func (c * Context ) ResultZeroblob (n ZeroBlobLength ) {
101
+ func (c * SQLiteContext ) ResultZeroblob (n ZeroBlobLength ) {
102
102
C .sqlite3_result_zeroblob ((* C .sqlite3_context )(c ), C .int (n ))
103
103
}
0 commit comments