mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 03:32:24 -06:00
Update dependencies (#333)
This commit is contained in:
parent
ce22e03f9d
commit
182b4eea73
848 changed files with 377869 additions and 107280 deletions
43
vendor/modernc.org/sqlite/Makefile
generated
vendored
43
vendor/modernc.org/sqlite/Makefile
generated
vendored
|
|
@ -23,6 +23,7 @@ all: editor
|
|||
GOOS=linux GOARCH=amd64 go build -v ./...
|
||||
GOOS=linux GOARCH=arm go build -v ./...
|
||||
GOOS=linux GOARCH=arm64 go build -v ./...
|
||||
GOOS=linux GOARCH=s390x go build -v ./...
|
||||
GOOS=windows GOARCH=386 go build -v ./...
|
||||
GOOS=windows GOARCH=amd64 go build -v ./...
|
||||
golint 2>&1 | grep -v $(ngrep) || true
|
||||
|
|
@ -36,28 +37,48 @@ all: editor
|
|||
|
||||
build_all_targets:
|
||||
GOOS=darwin GOARCH=amd64 go build -v ./...
|
||||
GOOS=darwin GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=darwin GOARCH=arm64 go build -v ./...
|
||||
GOOS=darwin GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=freebsd GOARCH=amd64 go build -v ./...
|
||||
GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=386 go build -v ./...
|
||||
GOOS=linux GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=amd64 go build -v ./...
|
||||
GOOS=linux GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=arm go build -v ./...
|
||||
GOOS=linux GOARCH=arm go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=arm64 go build -v ./...
|
||||
#TODO GOOS=linux GOARCH=s390x go build -v ./...
|
||||
GOOS=linux GOARCH=arm64 go test -c -o /dev/null
|
||||
GOOS=linux GOARCH=s390x go build -v ./...
|
||||
GOOS=linux GOARCH=s390x go test -c -o /dev/null
|
||||
GOOS=netbsd GOARCH=amd64 go build -v ./...
|
||||
GOOS=netbsd GOARCH=amd64 go test -c -o /dev/null
|
||||
GOOS=windows GOARCH=386 go build -v ./...
|
||||
GOOS=windows GOARCH=386 go test -c -o /dev/null
|
||||
GOOS=windows GOARCH=amd64 go build -v ./...
|
||||
GOOS=windows GOARCH=amd64 go test -c -o /dev/null
|
||||
echo done
|
||||
|
||||
darwin_amd64:
|
||||
TARGET_GOOS=darwin TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-darwin-amd64
|
||||
GOOS=darwin GOARCH=amd64 go build -v ./...
|
||||
@echo "Should be executed only on darwin/amd64."
|
||||
go generate 2>&1 | tee log-generate
|
||||
go build -v ./...
|
||||
|
||||
darwin_arm64:
|
||||
TARGET_GOOS=darwin TARGET_GOARCH=arm64 go generate 2>&1 | tee /tmp/log-generate-sqlite-darwin-arm64
|
||||
GOOS=darwin GOARCH=arm64 go build -v ./...
|
||||
@echo "Should be executed only on darwin/arm64."
|
||||
go generate 2>&1 | tee log-generate
|
||||
go build -v ./...
|
||||
|
||||
freebsd_amd64:
|
||||
TARGET_GOOS=freebsd TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-freebsd-amd64
|
||||
GOOS=freebsd GOARCH=amd64 go build -v ./...
|
||||
@echo "Should be executed only on freebsd/amd64."
|
||||
go generate 2>&1 | tee log-generate
|
||||
go build -v ./...
|
||||
|
||||
netbsd_amd64:
|
||||
@echo "Should be executed only on netbsd/amd64."
|
||||
go generate 2>&1 | tee log-generate
|
||||
go build -v ./...
|
||||
|
||||
linux_amd64:
|
||||
TARGET_GOOS=linux TARGET_GOARCH=amd64 go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-amd64
|
||||
|
|
@ -67,12 +88,16 @@ linux_386:
|
|||
CCGO_CPP=i686-linux-gnu-cpp TARGET_GOARCH=386 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-386
|
||||
GOOS=linux GOARCH=386 go build -v ./...
|
||||
|
||||
linux_arm_on_linux_amd64:
|
||||
CCGO_CPP=arm-linux-gnueabi-cpp TARGET_GOARCH=arm TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm
|
||||
GOOS=linux GOARCH=arm go build -v ./...
|
||||
|
||||
linux_arm:
|
||||
CCGO_CPP=arm-linux-gnueabi-cpp-8 TARGET_GOARCH=arm TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm
|
||||
go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm
|
||||
GOOS=linux GOARCH=arm go build -v ./...
|
||||
|
||||
linux_arm64:
|
||||
CCGO_CPP=aarch64-linux-gnu-cpp-8 TARGET_GOARCH=arm64 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm64
|
||||
CCGO_CPP=aarch64-linux-gnu-cpp TARGET_GOARCH=arm64 TARGET_GOOS=linux go generate 2>&1 | tee /tmp/log-generate-sqlite-linux-arm64
|
||||
GOOS=linux GOARCH=arm64 go build -v ./...
|
||||
|
||||
linux_s390x:
|
||||
|
|
|
|||
15
vendor/modernc.org/sqlite/doc.go
generated
vendored
15
vendor/modernc.org/sqlite/doc.go
generated
vendored
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package sqlite is a CGo-free port of SQLite.
|
||||
// Package sqlite is a CGo-free port of SQLite/SQLite3 v3.36.0.
|
||||
//
|
||||
// SQLite is an in-process implementation of a self-contained, serverless,
|
||||
// zero-configuration, transactional SQL database engine.
|
||||
|
|
@ -20,14 +20,6 @@
|
|||
// linux arm64
|
||||
// windows amd64
|
||||
//
|
||||
// The windows/amd64 has currently experimental/preview status. Tcl tests
|
||||
// report an unresolved yet memory leak, see
|
||||
// https://gitlab.com/cznic/sqlite/-/issues/23 for more details.
|
||||
//
|
||||
// Planned platforms and architectures
|
||||
//
|
||||
// windows 386
|
||||
//
|
||||
// Builders
|
||||
//
|
||||
// Builder results available at
|
||||
|
|
@ -36,6 +28,11 @@
|
|||
//
|
||||
// Changelog
|
||||
//
|
||||
// 2021-11-13 v1.14.0:
|
||||
//
|
||||
// Support windows/amd64. This target had previously only experimental status
|
||||
// because of a now resolved memory leak.
|
||||
//
|
||||
// 2021-09-07 v1.13.0:
|
||||
//
|
||||
// Support freebsd/amd64.
|
||||
|
|
|
|||
45
vendor/modernc.org/sqlite/generator.go
generated
vendored
45
vendor/modernc.org/sqlite/generator.go
generated
vendored
|
|
@ -372,6 +372,7 @@ func fail(s string, args ...interface{}) {
|
|||
}
|
||||
|
||||
func main() {
|
||||
fmt.Printf("Running on %s/%s.\n", runtime.GOOS, runtime.GOARCH)
|
||||
env := os.Getenv("GO_GENERATE")
|
||||
goarch := runtime.GOARCH
|
||||
goos := runtime.GOOS
|
||||
|
|
@ -393,13 +394,15 @@ func main() {
|
|||
}
|
||||
more = append(more, ndebug...)
|
||||
download()
|
||||
// experimental pthreads support currently only on linux/amd64
|
||||
if goos != "linux" || goarch != "amd64" {
|
||||
switch fmt.Sprintf("%s/%s", goos, goarch) {
|
||||
case "linux/amd64":
|
||||
// experimental pthreads support currently only on linux/amd64
|
||||
default:
|
||||
configProduction = append(configProduction, "-DSQLITE_MUTEX_NOOP")
|
||||
configTest = append(configTest, "-DSQLITE_MUTEX_NOOP")
|
||||
}
|
||||
switch goos {
|
||||
case "linux", "freebsd":
|
||||
case "linux", "freebsd", "netbsd":
|
||||
configProduction = append(configProduction, "-DSQLITE_OS_UNIX=1")
|
||||
case "darwin":
|
||||
configProduction = append(configProduction,
|
||||
|
|
@ -447,7 +450,7 @@ func configure(goos, goarch string) {
|
|||
cmd.Run()
|
||||
var args []string
|
||||
switch goos {
|
||||
case "linux", "freebsd":
|
||||
case "linux", "freebsd", "netbsd":
|
||||
// nop
|
||||
case "darwin":
|
||||
args = append(args, "--with-tcl=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework")
|
||||
|
|
@ -576,6 +579,31 @@ func makeTestfixture(goos, goarch string, more []string) {
|
|||
}
|
||||
configure(goos, goarch)
|
||||
|
||||
var defines, includes []string
|
||||
switch goos {
|
||||
case "freebsd":
|
||||
includes = []string{"-I/usr/local/include/tcl8.6"}
|
||||
case "linux":
|
||||
includes = []string{"-I/usr/include/tcl8.6"}
|
||||
case "windows":
|
||||
includes = []string{"-I/usr/include/tcl8.6"}
|
||||
case "netbsd":
|
||||
includes = []string{"-I/usr/pkg/include"}
|
||||
defines = []string{
|
||||
"-D__libc_cond_broadcast=pthread_cond_broadcast",
|
||||
"-D__libc_cond_destroy=pthread_cond_destroy",
|
||||
"-D__libc_cond_init=pthread_cond_init",
|
||||
"-D__libc_cond_signal=pthread_cond_signal",
|
||||
"-D__libc_cond_wait=pthread_cond_wait",
|
||||
"-D__libc_mutex_destroy=pthread_mutex_destroy",
|
||||
"-D__libc_mutex_init=pthread_mutex_init",
|
||||
"-D__libc_mutex_lock=pthread_mutex_lock",
|
||||
"-D__libc_mutex_trylock=pthread_mutex_trylock",
|
||||
"-D__libc_mutex_unlock=pthread_mutex_unlock",
|
||||
"-D__libc_thr_yield=sched_yield",
|
||||
}
|
||||
}
|
||||
|
||||
args := join(
|
||||
[]string{
|
||||
"ccgo",
|
||||
|
|
@ -584,7 +612,10 @@ func makeTestfixture(goos, goarch string, more []string) {
|
|||
"-DSQLITE_SERVER=1",
|
||||
"-DTCLSH_INIT_PROC=sqlite3TestInit",
|
||||
"-D_HAVE_SQLITE_CONFIG_H",
|
||||
"-I/usr/include/tcl8.6", //TODO should not be hardcoded
|
||||
},
|
||||
defines,
|
||||
includes,
|
||||
[]string{
|
||||
"-export-defines", "",
|
||||
"-export-fields", "F",
|
||||
"-trace-translation-units",
|
||||
|
|
@ -607,10 +638,6 @@ func makeTestfixture(goos, goarch string, more []string) {
|
|||
more,
|
||||
configTest,
|
||||
)
|
||||
// experimental pthreads support currently only on linux/amd64
|
||||
if goos != "linux" || goarch != "amd64" {
|
||||
args = append(args, "-lmodernc.org/sqlite/internal/libc2")
|
||||
}
|
||||
task := ccgo.NewTask(args, nil, nil)
|
||||
if err := task.Main(); err != nil {
|
||||
fail("%s\n", err)
|
||||
|
|
|
|||
63
vendor/modernc.org/sqlite/lib/capi_linux_s390x.go
generated
vendored
63
vendor/modernc.org/sqlite/lib/capi_linux_s390x.go
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o lib/sqlite_linux_s390x.go -trace-translation-units testdata/sqlite-amalgamation-3350500/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1', DO NOT EDIT.
|
||||
// Code generated by 'ccgo -DSQLITE_PRIVATE= -export-defines -export-enums -export-externs X -export-fields F -export-typedefs -pkgname sqlite3 -o lib/sqlite_linux_s390x.go -trace-translation-units testdata/sqlite-amalgamation-3360000/sqlite3.c -DNDEBUG -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DSQLITE_CORE -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_ENABLE_PREUPDATE_HOOK -DSQLITE_ENABLE_RBU -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_SNAPSHOT -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MUTEX_APPDEF=1 -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1', DO NOT EDIT.
|
||||
|
||||
package sqlite3
|
||||
|
||||
|
|
@ -273,6 +273,8 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3ExprIsTableConstant": {},
|
||||
"sqlite3ExprIsVector": {},
|
||||
"sqlite3ExprListAppend": {},
|
||||
"sqlite3ExprListAppendGrow": {},
|
||||
"sqlite3ExprListAppendNew": {},
|
||||
"sqlite3ExprListAppendVector": {},
|
||||
"sqlite3ExprListCheckLength": {},
|
||||
"sqlite3ExprListCompare": {},
|
||||
|
|
@ -320,6 +322,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3Fts5Init": {},
|
||||
"sqlite3FunctionSearch": {},
|
||||
"sqlite3FunctionUsesThisSrc": {},
|
||||
"sqlite3GenerateColumnNames": {},
|
||||
"sqlite3GenerateConstraintChecks": {},
|
||||
"sqlite3GenerateIndexKey": {},
|
||||
"sqlite3GenerateRowDelete": {},
|
||||
|
|
@ -406,6 +409,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3MemCompare": {},
|
||||
"sqlite3MemJournalOpen": {},
|
||||
"sqlite3MemSetDefault": {},
|
||||
"sqlite3MemdbInit": {},
|
||||
"sqlite3MisuseError": {},
|
||||
"sqlite3MulInt64": {},
|
||||
"sqlite3MultiWrite": {},
|
||||
|
|
@ -628,6 +632,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3SelectExprHeight": {},
|
||||
"sqlite3SelectNew": {},
|
||||
"sqlite3SelectOpName": {},
|
||||
"sqlite3SelectPopWith": {},
|
||||
"sqlite3SelectPrep": {},
|
||||
"sqlite3SelectTrace": {},
|
||||
"sqlite3SelectWalkFail": {},
|
||||
|
|
@ -908,6 +913,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3WalkSelect": {},
|
||||
"sqlite3WalkSelectExpr": {},
|
||||
"sqlite3WalkSelectFrom": {},
|
||||
"sqlite3WalkWinDefnDummyCallback": {},
|
||||
"sqlite3WalkerDepthDecrease": {},
|
||||
"sqlite3WalkerDepthIncrease": {},
|
||||
"sqlite3WhereBegin": {},
|
||||
|
|
@ -953,6 +959,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3WindowUpdate": {},
|
||||
"sqlite3WithAdd": {},
|
||||
"sqlite3WithDelete": {},
|
||||
"sqlite3WithDup": {},
|
||||
"sqlite3WithPush": {},
|
||||
"sqlite3WritableSchema": {},
|
||||
"sqlite3_aggregate_context": {},
|
||||
|
|
@ -1044,6 +1051,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3_db_release_memory": {},
|
||||
"sqlite3_db_status": {},
|
||||
"sqlite3_declare_vtab": {},
|
||||
"sqlite3_deserialize": {},
|
||||
"sqlite3_drop_modules": {},
|
||||
"sqlite3_enable_load_extension": {},
|
||||
"sqlite3_enable_shared_cache": {},
|
||||
|
|
@ -1064,7 +1072,6 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3_free": {},
|
||||
"sqlite3_free_filename": {},
|
||||
"sqlite3_free_table": {},
|
||||
"sqlite3_fts5_may_be_corrupt": {},
|
||||
"sqlite3_get_autocommit": {},
|
||||
"sqlite3_get_auxdata": {},
|
||||
"sqlite3_get_table": {},
|
||||
|
|
@ -1106,6 +1113,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3_prepare16_v3": {},
|
||||
"sqlite3_prepare_v2": {},
|
||||
"sqlite3_prepare_v3": {},
|
||||
"sqlite3_preupdate_blobwrite": {},
|
||||
"sqlite3_preupdate_count": {},
|
||||
"sqlite3_preupdate_depth": {},
|
||||
"sqlite3_preupdate_hook": {},
|
||||
|
|
@ -1143,6 +1151,7 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3_rollback_hook": {},
|
||||
"sqlite3_rtree_geometry_callback": {},
|
||||
"sqlite3_rtree_query_callback": {},
|
||||
"sqlite3_serialize": {},
|
||||
"sqlite3_set_authorizer": {},
|
||||
"sqlite3_set_auxdata": {},
|
||||
"sqlite3_set_last_insert_rowid": {},
|
||||
|
|
@ -1230,6 +1239,35 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3_wal_checkpoint": {},
|
||||
"sqlite3_wal_checkpoint_v2": {},
|
||||
"sqlite3_wal_hook": {},
|
||||
"sqlite3aEQb": {},
|
||||
"sqlite3aGTb": {},
|
||||
"sqlite3aLTb": {},
|
||||
"sqlite3changegroup_add": {},
|
||||
"sqlite3changegroup_add_strm": {},
|
||||
"sqlite3changegroup_delete": {},
|
||||
"sqlite3changegroup_new": {},
|
||||
"sqlite3changegroup_output": {},
|
||||
"sqlite3changegroup_output_strm": {},
|
||||
"sqlite3changeset_apply": {},
|
||||
"sqlite3changeset_apply_strm": {},
|
||||
"sqlite3changeset_apply_v2": {},
|
||||
"sqlite3changeset_apply_v2_strm": {},
|
||||
"sqlite3changeset_concat": {},
|
||||
"sqlite3changeset_concat_strm": {},
|
||||
"sqlite3changeset_conflict": {},
|
||||
"sqlite3changeset_finalize": {},
|
||||
"sqlite3changeset_fk_conflicts": {},
|
||||
"sqlite3changeset_invert": {},
|
||||
"sqlite3changeset_invert_strm": {},
|
||||
"sqlite3changeset_new": {},
|
||||
"sqlite3changeset_next": {},
|
||||
"sqlite3changeset_old": {},
|
||||
"sqlite3changeset_op": {},
|
||||
"sqlite3changeset_pk": {},
|
||||
"sqlite3changeset_start": {},
|
||||
"sqlite3changeset_start_strm": {},
|
||||
"sqlite3changeset_start_v2": {},
|
||||
"sqlite3changeset_start_v2_strm": {},
|
||||
"sqlite3one": {},
|
||||
"sqlite3rbu_bp_progress": {},
|
||||
"sqlite3rbu_close": {},
|
||||
|
|
@ -1244,4 +1282,25 @@ var CAPI = map[string]struct{}{
|
|||
"sqlite3rbu_temp_size": {},
|
||||
"sqlite3rbu_temp_size_limit": {},
|
||||
"sqlite3rbu_vacuum": {},
|
||||
"sqlite3rebaser_configure": {},
|
||||
"sqlite3rebaser_create": {},
|
||||
"sqlite3rebaser_delete": {},
|
||||
"sqlite3rebaser_rebase": {},
|
||||
"sqlite3rebaser_rebase_strm": {},
|
||||
"sqlite3session_attach": {},
|
||||
"sqlite3session_changeset": {},
|
||||
"sqlite3session_changeset_size": {},
|
||||
"sqlite3session_changeset_strm": {},
|
||||
"sqlite3session_config": {},
|
||||
"sqlite3session_create": {},
|
||||
"sqlite3session_delete": {},
|
||||
"sqlite3session_diff": {},
|
||||
"sqlite3session_enable": {},
|
||||
"sqlite3session_indirect": {},
|
||||
"sqlite3session_isempty": {},
|
||||
"sqlite3session_memory_used": {},
|
||||
"sqlite3session_object_config": {},
|
||||
"sqlite3session_patchset": {},
|
||||
"sqlite3session_patchset_strm": {},
|
||||
"sqlite3session_table_filter": {},
|
||||
}
|
||||
|
|
|
|||
1304
vendor/modernc.org/sqlite/lib/capi_netbsd_amd64.go
generated
vendored
Normal file
1304
vendor/modernc.org/sqlite/lib/capi_netbsd_amd64.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
17
vendor/modernc.org/sqlite/lib/mutex.go
generated
vendored
17
vendor/modernc.org/sqlite/lib/mutex.go
generated
vendored
|
|
@ -21,22 +21,25 @@ func init() {
|
|||
panic(fmt.Errorf("sqlite: thread safety configuration error"))
|
||||
}
|
||||
|
||||
varArgs := libc.Xmalloc(tls, types.Size_t(unsafe.Sizeof(uintptr(0))))
|
||||
if varArgs == 0 {
|
||||
panic(fmt.Errorf("cannot allocate memory"))
|
||||
}
|
||||
switch fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH) {
|
||||
case "linux/amd64":
|
||||
// experimental pthreads support currently only on linux/amd64
|
||||
default:
|
||||
varArgs := libc.Xmalloc(tls, types.Size_t(unsafe.Sizeof(uintptr(0))))
|
||||
if varArgs == 0 {
|
||||
panic(fmt.Errorf("cannot allocate memory"))
|
||||
}
|
||||
|
||||
// experimental pthreads support currently only on linux/amd64
|
||||
if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
|
||||
// int sqlite3_config(int, ...);
|
||||
if rc := Xsqlite3_config(tls, SQLITE_CONFIG_MUTEX, libc.VaList(varArgs, uintptr(unsafe.Pointer(&mutexMethods)))); rc != SQLITE_OK {
|
||||
p := Xsqlite3_errstr(tls, rc)
|
||||
str := libc.GoString(p)
|
||||
panic(fmt.Errorf("sqlite: failed to configure mutex methods: %v", str))
|
||||
}
|
||||
|
||||
libc.Xfree(tls, varArgs)
|
||||
}
|
||||
|
||||
libc.Xfree(tls, varArgs)
|
||||
tls.Close()
|
||||
}
|
||||
|
||||
|
|
|
|||
4126
vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go
generated
vendored
4126
vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go
generated
vendored
File diff suppressed because one or more lines are too long
11755
vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go
generated
vendored
11755
vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go
generated
vendored
File diff suppressed because one or more lines are too long
2624
vendor/modernc.org/sqlite/lib/sqlite_linux_386.go
generated
vendored
2624
vendor/modernc.org/sqlite/lib/sqlite_linux_386.go
generated
vendored
File diff suppressed because it is too large
Load diff
9670
vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go
generated
vendored
9670
vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go
generated
vendored
File diff suppressed because one or more lines are too long
5460
vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
generated
vendored
5460
vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go
generated
vendored
File diff suppressed because it is too large
Load diff
12209
vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go
generated
vendored
12209
vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go
generated
vendored
File diff suppressed because one or more lines are too long
40421
vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go
generated
vendored
40421
vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go
generated
vendored
File diff suppressed because one or more lines are too long
192083
vendor/modernc.org/sqlite/lib/sqlite_netbsd_amd64.go
generated
vendored
Normal file
192083
vendor/modernc.org/sqlite/lib/sqlite_netbsd_amd64.go
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19229
vendor/modernc.org/sqlite/lib/sqlite_windows_amd64.go
generated
vendored
19229
vendor/modernc.org/sqlite/lib/sqlite_windows_amd64.go
generated
vendored
File diff suppressed because it is too large
Load diff
56
vendor/modernc.org/sqlite/sqlite.go
generated
vendored
56
vendor/modernc.org/sqlite/sqlite.go
generated
vendored
|
|
@ -3,7 +3,7 @@
|
|||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:generate go run generator.go
|
||||
//go:generate go fmt ./...
|
||||
//go:generate gofmt -l -s -w .
|
||||
|
||||
package sqlite // import "modernc.org/sqlite"
|
||||
|
||||
|
|
@ -336,6 +336,22 @@ func (c *conn) parseTimeString(s0 string, x int) (interface{}, bool) {
|
|||
return s0, false
|
||||
}
|
||||
|
||||
// writeTimeFormats are the names and formats supported
|
||||
// by the `_time_format` DSN query param.
|
||||
var writeTimeFormats = map[string]string{
|
||||
"sqlite": parseTimeFormats[0],
|
||||
}
|
||||
|
||||
func (c *conn) formatTime(t time.Time) string {
|
||||
// Before configurable write time formats were supported,
|
||||
// time.Time.String was used. Maintain that default to
|
||||
// keep existing driver users formatting times the same.
|
||||
if c.writeTimeFormat == "" {
|
||||
return t.String()
|
||||
}
|
||||
return t.Format(c.writeTimeFormat)
|
||||
}
|
||||
|
||||
// RowsColumnTypeDatabaseTypeName may be implemented by Rows. It should return
|
||||
// the database system type name without the length. Type names should be
|
||||
// uppercase. Examples of returned types: "VARCHAR", "NVARCHAR", "VARCHAR2",
|
||||
|
|
@ -726,6 +742,8 @@ type conn struct {
|
|||
// Context handling can cause conn.Close and conn.interrupt to be invoked
|
||||
// concurrently.
|
||||
sync.Mutex
|
||||
|
||||
writeTimeFormat string
|
||||
}
|
||||
|
||||
func newConn(dsn string) (*conn, error) {
|
||||
|
|
@ -759,7 +777,7 @@ func newConn(dsn string) (*conn, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if err = applyPragmas(c, query); err != nil {
|
||||
if err = applyQueryParams(c, query); err != nil {
|
||||
c.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -767,11 +785,12 @@ func newConn(dsn string) (*conn, error) {
|
|||
return c, nil
|
||||
}
|
||||
|
||||
func applyPragmas(c *conn, query string) error {
|
||||
func applyQueryParams(c *conn, query string) error {
|
||||
q, err := url.ParseQuery(query)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, v := range q["_pragma"] {
|
||||
cmd := "pragma " + v
|
||||
_, err := c.exec(context.Background(), cmd, nil)
|
||||
|
|
@ -779,6 +798,16 @@ func applyPragmas(c *conn, query string) error {
|
|||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if v := q.Get("_time_format"); v != "" {
|
||||
f, ok := writeTimeFormats[v]
|
||||
if !ok {
|
||||
return fmt.Errorf("unknown _time_format %q", v)
|
||||
}
|
||||
c.writeTimeFormat = f
|
||||
return nil
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -872,12 +901,17 @@ func (c *conn) changes() (int, error) {
|
|||
func (c *conn) step(pstmt uintptr) (int, error) {
|
||||
for {
|
||||
switch rc := sqlite3.Xsqlite3_step(c.tls, pstmt); rc {
|
||||
case sqliteLockedSharedcache, sqlite3.SQLITE_BUSY:
|
||||
case sqliteLockedSharedcache:
|
||||
if err := c.retry(pstmt); err != nil {
|
||||
return sqlite3.SQLITE_LOCKED, err
|
||||
}
|
||||
default:
|
||||
case
|
||||
sqlite3.SQLITE_DONE,
|
||||
sqlite3.SQLITE_ROW:
|
||||
|
||||
return int(rc), nil
|
||||
default:
|
||||
return int(rc), c.errstr(rc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1000,7 +1034,7 @@ func (c *conn) bind(pstmt uintptr, n int, args []driver.NamedValue) (allocs []ui
|
|||
return allocs, err
|
||||
}
|
||||
case time.Time:
|
||||
if p, err = c.bindText(pstmt, i, x.String()); err != nil {
|
||||
if p, err = c.bindText(pstmt, i, c.formatTime(x)); err != nil {
|
||||
return allocs, err
|
||||
}
|
||||
case nil:
|
||||
|
|
@ -1135,7 +1169,7 @@ func (c *conn) prepareV2(zSQL *uintptr) (pstmt uintptr, err error) {
|
|||
case sqlite3.SQLITE_OK:
|
||||
*zSQL = *(*uintptr)(unsafe.Pointer(pptail))
|
||||
return *(*uintptr)(unsafe.Pointer(ppstmt)), nil
|
||||
case sqliteLockedSharedcache, sqlite3.SQLITE_BUSY:
|
||||
case sqliteLockedSharedcache:
|
||||
if err := c.retry(0); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
@ -1219,11 +1253,15 @@ func (c *conn) errstr(rc int32) error {
|
|||
p := sqlite3.Xsqlite3_errstr(c.tls, rc)
|
||||
str := libc.GoString(p)
|
||||
p = sqlite3.Xsqlite3_errmsg(c.tls, c.db)
|
||||
var s string
|
||||
if rc == sqlite3.SQLITE_BUSY {
|
||||
s = " (SQLITE_BUSY)"
|
||||
}
|
||||
switch msg := libc.GoString(p); {
|
||||
case msg == str:
|
||||
return &Error{msg: fmt.Sprintf("%s (%v)", str, rc), code: int(rc)}
|
||||
return &Error{msg: fmt.Sprintf("%s (%v)%s", str, rc, s), code: int(rc)}
|
||||
default:
|
||||
return &Error{msg: fmt.Sprintf("%s: %s (%v)", str, msg, rc), code: int(rc)}
|
||||
return &Error{msg: fmt.Sprintf("%s: %s (%v)%s", str, msg, rc, s), code: int(rc)}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue