Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
d251084b
Commit
d251084b
authored
Dec 07, 2011
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix signature of the BusyHandler and ProgressHandler callbacks.
parent
ddcc9654
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
trace.go
trace.go
+6
-5
trace_test.go
trace_test.go
+2
-2
No files found.
trace.go
View file @
d251084b
...
...
@@ -187,8 +187,9 @@ func (c *Conn) SetAuthorizer(f Authorizer, udp interface{}) error {
return
c
.
error
(
C
.
goSqlite3SetAuthorizer
(
c
.
db
,
unsafe
.
Pointer
(
c
.
authorizer
)))
}
// Returns true to try again.
// See Conn.BusyHandler
type
BusyHandler
func
(
udp
interface
{},
count
int
)
int
type
BusyHandler
func
(
udp
interface
{},
count
int
)
bool
type
sqliteBusyHandler
struct
{
f
BusyHandler
...
...
@@ -199,7 +200,7 @@ type sqliteBusyHandler struct {
func
goXBusy
(
udp
unsafe
.
Pointer
,
count
C
.
int
)
C
.
int
{
arg
:=
(
*
sqliteBusyHandler
)(
udp
)
result
:=
arg
.
f
(
arg
.
udp
,
int
(
count
))
return
C
.
int
(
result
)
return
btoc
int
(
result
)
}
// Register a callback to handle SQLITE_BUSY errors
...
...
@@ -215,9 +216,9 @@ func (c *Conn) BusyHandler(f BusyHandler, udp interface{}) error {
return
c
.
error
(
C
.
goSqlite3BusyHandler
(
c
.
db
,
unsafe
.
Pointer
(
c
.
busyHandler
)))
}
// Returns
non-zero
to interrupt.
// Returns
true
to interrupt.
// See Conn.ProgressHandler
type
ProgressHandler
func
(
udp
interface
{})
int
type
ProgressHandler
func
(
udp
interface
{})
bool
type
sqliteProgressHandler
struct
{
f
ProgressHandler
...
...
@@ -228,7 +229,7 @@ type sqliteProgressHandler struct {
func
goXProgress
(
udp
unsafe
.
Pointer
)
C
.
int
{
arg
:=
(
*
sqliteProgressHandler
)(
udp
)
result
:=
arg
.
f
(
arg
.
udp
)
return
C
.
int
(
result
)
return
btoc
int
(
result
)
}
// Query progress callbacks
...
...
trace_test.go
View file @
d251084b
...
...
@@ -23,9 +23,9 @@ func profile(d interface{}, sql string, nanoseconds uint64) {
//fmt.Printf("%s: %s = %d\n", d, sql, nanoseconds/1000)
}
func
progressHandler
(
d
interface
{})
int
{
func
progressHandler
(
d
interface
{})
bool
{
//fmt.Print("+")
return
0
return
false
}
func
commitHook
(
d
interface
{})
int
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment