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
89b245d6
Commit
89b245d6
authored
Aug 02, 2011
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trace support.
parent
d9b115e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
trace.go
trace.go
+40
-0
No files found.
trace.go
0 → 100644
View file @
89b245d6
// Copyright 2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package sqlite provides access to the SQLite library, version 3.
package
sqlite
/*
#include <sqlite3.h>
#include <stdlib.h>
extern void goXTrace(void *pArg, const char *t);
static void goSqlite3Trace(sqlite3 *db, void *pArg) {
sqlite3_trace(db, goXTrace, pArg);
}
*/
import
"C"
import
(
"unsafe"
)
type
SqliteTrace
func
(
d
interface
{},
t
string
)
type
sqliteTrace
struct
{
f
SqliteTrace
d
interface
{}
}
//export goXTrace
func
goXTrace
(
pArg
unsafe
.
Pointer
,
t
*
C
.
char
)
{
arg
:=
(
*
sqliteTrace
)(
pArg
)
arg
.
f
(
arg
.
d
,
C
.
GoString
(
t
))
}
func
(
c
*
Conn
)
Trace
(
f
SqliteTrace
,
arg
interface
{})
{
pArg
:=
unsafe
.
Pointer
(
&
sqliteTrace
{
f
,
arg
})
C
.
goSqlite3Trace
(
c
.
db
,
pArg
)
}
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