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
4aca652e
Commit
4aca652e
authored
Oct 27, 2012
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sqlite3_next_stmt misuse and docs.
parent
c45ae22f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
README
README
+2
-2
blob.go
blob.go
+1
-0
sqlite.go
sqlite.go
+2
-1
No files found.
README
View file @
4aca652e
...
...
@@ -20,7 +20,7 @@ Stmt#ScanByIndex/ScanByName are added to test NULL value.
Currently, the weak point of the binding is the *Scan* methods:
The original implementation is using this strategy:
- convert the stored value to a []byte by calling sqlite3_column_b
ytes
,
- convert the stored value to a []byte by calling sqlite3_column_b
lob
,
- convert the bytes to the desired Go type with correct feedback in case of illegal conversion,
- but apparently no support for NULL value.
Using the native sqlite3_column_x implies:
...
...
@@ -100,4 +100,4 @@ BenchmarkEnabledCache 1000000 1133 ns/op
BenchmarkLike 1000000 2508 ns/op
BenchmarkHalf 500000 4811 ns/op
BenchmarkRegexp 500000 6170 ns/op
\ No newline at end of file
BenchmarkRegexp 500000 6170 ns/op
blob.go
View file @
4aca652e
...
...
@@ -17,6 +17,7 @@ import (
)
// io.ReadCloser adapter to BLOB
// (See http://sqlite.org/c3ref/blob.html)
type
BlobReader
struct
{
c
*
Conn
bl
*
C
.
sqlite3_blob
...
...
sqlite.go
View file @
4aca652e
...
...
@@ -158,6 +158,7 @@ func (c *Conn) LastError() error {
}
// Database connection handle
// (See http://sqlite.org/c3ref/sqlite3.html)
type
Conn
struct
{
db
*
C
.
sqlite3
stmtCache
*
cache
...
...
@@ -501,7 +502,7 @@ func (c *Conn) Close() error {
Log
(
C
.
SQLITE_MISUSE
,
"Dangling statement (not finalize):
\"
"
+
C
.
GoString
(
C
.
sqlite3_sql
(
stmt
))
+
"
\"
"
)
}
C
.
sqlite3_finalize
(
stmt
)
stmt
=
C
.
sqlite3_next_stmt
(
c
.
db
,
stmt
)
stmt
=
C
.
sqlite3_next_stmt
(
c
.
db
,
nil
)
}
rv
:=
C
.
sqlite3_close
(
c
.
db
)
...
...
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