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
3d0c6e69
Commit
3d0c6e69
authored
Jan 11, 2014
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint.
parent
c203dcae
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
README.md
README.md
+1
-1
date.go
date.go
+3
-3
driver.go
driver.go
+1
-1
stmt_test.go
stmt_test.go
+4
-3
vtab_test.go
vtab_test.go
+3
-2
No files found.
README.md
View file @
3d0c6e69
...
...
@@ -4,7 +4,7 @@ Yet another SQLite binding based on:
This binding implements the "database/sql/driver" interface.
See
[
package documentation
](
http://godoc.org/github.com/gwenn/gosqlite
)
.
[
![GoDoc
](
https://godoc.org/github.com/gwenn/gosqlite?status.png
)
](https://godoc.org/github.com/gwenn/gosqlite)
[
![Build Status
][
1
]
][2]
...
...
date.go
View file @
3d0c6e69
...
...
@@ -50,7 +50,7 @@ func (t *UnixTime) Scan(src interface{}) error {
*
t
=
UnixTime
(
time
.
Unix
(
unixepoch
,
0
))
// local time
return
nil
}
return
fmt
.
Errorf
(
"
U
nsupported UnixTime src: %T"
,
src
)
return
fmt
.
Errorf
(
"
u
nsupported UnixTime src: %T"
,
src
)
}
// Value implements the database/sql/driver/Valuer interface
...
...
@@ -73,7 +73,7 @@ func (t *JulianTime) Scan(src interface{}) error {
*
t
=
JulianTime
(
JulianDayToLocalTime
(
jd
))
// local time
return
nil
}
return
fmt
.
Errorf
(
"
U
nsupported JulianTime src: %T"
,
src
)
return
fmt
.
Errorf
(
"
u
nsupported JulianTime src: %T"
,
src
)
}
// Value implements the database/sql/driver/Valuer interface
...
...
@@ -100,7 +100,7 @@ func (t *TimeStamp) Scan(src interface{}) error {
*
t
=
TimeStamp
(
v
)
return
nil
}
return
fmt
.
Errorf
(
"
U
nsupported TimeStamp src: %T"
,
src
)
return
fmt
.
Errorf
(
"
u
nsupported TimeStamp src: %T"
,
src
)
}
// Value implements the database/sql/driver/Valuer interface
...
...
driver.go
View file @
3d0c6e69
...
...
@@ -142,7 +142,7 @@ func (s *stmt) RowsAffected() (int64, error) {
func
(
s
*
stmt
)
Query
(
args
[]
driver
.
Value
)
(
driver
.
Rows
,
error
)
{
if
s
.
rowsRef
{
return
nil
,
errors
.
New
(
"
P
reviously returned Rows still not closed"
)
return
nil
,
errors
.
New
(
"
p
reviously returned Rows still not closed"
)
}
if
err
:=
s
.
bind
(
args
);
err
!=
nil
{
return
nil
,
err
...
...
stmt_test.go
View file @
3d0c6e69
...
...
@@ -5,13 +5,14 @@
package
sqlite_test
import
(
"github.com/bmizerany/assert"
.
"github.com/gwenn/gosqlite"
"math"
"reflect"
"testing"
"time"
"unsafe"
"github.com/bmizerany/assert"
.
"github.com/gwenn/gosqlite"
)
func
checkFinalize
(
s
*
Stmt
,
t
*
testing
.
T
)
{
...
...
@@ -480,7 +481,7 @@ func TestIntOnArch64(t *testing.T) {
createTable
(
db
,
t
)
if
unsafe
.
Sizeof
(
int
(
0
))
>
4
{
var
i
int
=
math
.
MaxInt64
var
i
=
math
.
MaxInt64
err
:=
db
.
Exec
(
"INSERT INTO test (int_num) VALUES (?)"
,
i
)
checkNoError
(
t
,
err
,
"insert error: %s"
)
var
r
int
...
...
vtab_test.go
View file @
3d0c6e69
...
...
@@ -6,9 +6,10 @@ package sqlite_test
import
(
"fmt"
"testing"
"github.com/bmizerany/assert"
.
"github.com/gwenn/gosqlite"
"testing"
)
type
testModule
struct
{
...
...
@@ -87,7 +88,7 @@ func (vc *testVTabCursor) Eof() bool {
func
(
vc
*
testVTabCursor
)
Column
(
c
*
Context
,
col
int
)
error
{
//fmt.Printf("testVTabCursor.Column(%d): %v\n", col, vc)
if
col
!=
0
{
return
fmt
.
Errorf
(
"
C
olumn index out of bounds: %d"
,
col
)
return
fmt
.
Errorf
(
"
c
olumn index out of bounds: %d"
,
col
)
}
c
.
ResultInt
(
vc
.
vTab
.
intarray
[
vc
.
index
])
return
nil
...
...
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