Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e25596

Browse files
authored
Merge pull request #2 from mattn/master
Keep up with upstream
2 parents 43e89c9 + ad30583 commit 8e25596

14 files changed

+31335
-21762
lines changed

‎.travis.yml

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,24 @@ addons:
88
apt:
99
update: true
1010

11-
env:
12-
matrix:
13-
- GOTAGS=
14-
- GOTAGS=libsqlite3
15-
- GOTAGS="sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable"
16-
- GOTAGS=sqlite_vacuum_full
17-
1811
go:
1912
- 1.9.x
2013
- 1.10.x
14+
- 1.11.x
15+
- master
2116

2217
before_install:
2318
- |
24-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
19+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
2520
brew update
26-
brew upgrade icu4c
27-
fi
28-
- |
29-
go get github.com/smartystreets/goconvey
30-
if [[ "${GOOS}" != "windows" ]]; then
31-
go get github.com/mattn/goveralls
32-
go get golang.org/x/tools/cmd/cover
3321
fi
22+
- go get github.com/smartystreets/goconvey
23+
- go get github.com/mattn/goveralls
24+
- go get golang.org/x/tools/cmd/cover
3425

3526
script:
36-
- GOOS=$(go env GOOS) GOARCH=$(go env GOARCH) go build -v -tags "${GOTAGS}" .
37-
- |
38-
if [[ "${GOOS}" != "windows" ]]; then
39-
$HOME/gopath/bin/goveralls -repotoken 3qJVUE0iQwqnCbmNcDsjYu1nh4J4KIFXx
40-
go test -race -v . -tags "${GOTAGS}"
41-
fi
27+
- $HOME/gopath/bin/goveralls -repotoken 3qJVUE0iQwqnCbmNcDsjYu1nh4J4KIFXx
28+
- go test -race -v . -tags ""
29+
- go test -race -v . -tags "libsqlite3"
30+
- go test -race -v . -tags "sqlite_allow_uri_authority sqlite_app_armor sqlite_foreign_keys sqlite_fts5 sqlite_icu sqlite_introspect sqlite_json sqlite_secure_delete sqlite_see sqlite_stat4 sqlite_trace sqlite_userauth sqlite_vacuum_incr sqlite_vtable sqlite_unlock_notify"
31+
- go test -race -v . -tags "sqlite_vacuum_full"

‎README.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ For easy building, I also put libTomCrypt related files in project.
1212

1313
sqlite3 driver conforming to the built-in database/sql interface
1414

15-
Supported Golang version:
16-
- 1.9.x
17-
- 1.10.x
15+
Supported Golang version: See .travis.yml
1816

1917
[This package follows the official Golang Release Policy.](https://golang.org/doc/devel/release.html#policy)
2018

@@ -88,6 +86,7 @@ This is also known as a DSN string. (Data Source Name).
8886

8987
Options are append after the filename of the SQLite database.
9088
The database filename and options are seperated by an `?` (Question Mark).
89+
Options should be URL-encoded (see [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)).
9190

9291
This also applies when using an in-memory database instead of a file.
9392

@@ -219,7 +218,7 @@ Additional information:
219218

220219
# Google Cloud Platform
221220

222-
Building on GCP is not possible because `Google Cloud Platform does not allow `gcc` to be executed.
221+
Building on GCP is not possible because Google Cloud Platform does not allow `gcc` to be executed.
223222

224223
Please work only with compiled final binaries.
225224

@@ -302,7 +301,7 @@ To compile this package on Windows OS you must have the `gcc` compiler installed
302301
3) Open a terminal for the TDM-GCC toolchain, can be found in the Windows Start menu.
303302
4) Navigate to your project folder and run the `go build ...` command for this package.
304303

305-
For example the TDM-GCC Toolchain can be found [here](ttps://sourceforge.net/projects/tdm-gcc/).
304+
For example the TDM-GCC Toolchain can be found [here](https://sourceforge.net/projects/tdm-gcc/).
306305

307306
## Errors
308307

@@ -311,7 +310,7 @@ For example the TDM-GCC Toolchain can be found [here](ttps://sourceforge.net/pro
311310
When receiving a compile time error referencing recompile with `-FPIC` then you
312311
are probably using a hardend system.
313312

314-
You can copile the library on a hardend system with the following command.
313+
You can compile the library on a hardend system with the following command.
315314

316315
```bash
317316
go build -ldflags '-extldflags=-fno-PIC'
@@ -505,7 +504,7 @@ For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatial
505504

506505
- Error: `database is locked`
507506

508-
When you get an database is locked. Please use the following options.
507+
When you get a database is locked. Please use the following options.
509508

510509
Add to DSN: `cache=shared`
511510

@@ -517,7 +516,7 @@ For an example see [shaxbee/go-spatialite](https://github.com/shaxbee/go-spatial
517516
Second please set the database connections of the SQL package to 1.
518517

519518
```go
520-
db.SetMaxOpenConn(1)
519+
db.SetMaxOpenConns(1)
521520
```
522521

523522
More information see [#209](https://github.com/mattn/go-sqlite3/issues/209)

‎callback.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ func updateHookTrampoline(handle uintptr, op int, db *C.char, table *C.char, row
7777
callback(op, C.GoString(db), C.GoString(table), rowid)
7878
}
7979

80+
//export authorizerTrampoline
81+
func authorizerTrampoline(handle uintptr, op int, arg1 *C.char, arg2 *C.char, arg3 *C.char) int {
82+
callback := lookupHandle(handle).(func(int, string, string, string) int)
83+
return callback(op, C.GoString(arg1), C.GoString(arg2), C.GoString(arg3))
84+
}
85+
8086
// Use handles to avoid passing Go pointers to C.
8187

8288
type handleVal struct {
@@ -362,7 +368,7 @@ func callbackRet(typ reflect.Type) (callbackRetConverter, error) {
362368
func callbackError(ctx *C.sqlite3_context, err error) {
363369
cstr := C.CString(err.Error())
364370
defer C.free(unsafe.Pointer(cstr))
365-
C.sqlite3_result_error(ctx, cstr, -1)
371+
C.sqlite3_result_error(ctx, cstr, C.int(-1))
366372
}
367373

368374
// Test support code. Tests are not allowed to import "C", so we can't

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /