0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-11-16 23:00:53 +01:00
dendrite/internal/sqlutil
0x1a8510f2 51ab0a8ccf
Fix moderncsqlite errors and rebase onto main (#2832)
This is #2819 but rebased on latest `main`. This PR is against main too
as opposed to the `moderncsqlite` branch.

The main change here is simply:

```go
// add query parameters to the dsn
if strings.Contains(dsn, "?") {
	dsn += "&"
} else {
	dsn += "?"
}

// wait some time before erroring if the db is locked
// https://gitlab.com/cznic/sqlite/-/issues/106#note_1058094993
dsn += "_pragma=busy_timeout%3d10000"
```

### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [x] I have added tests for PR _or_ I have justified why this PR
doesn't need tests.
* [x] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed off privately.

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-11-02 13:20:10 +00:00
..
migrate.go Tweak InsertMigration to avoid logging (#2720) 2022-09-22 15:53:15 +02:00
migrate_test.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
sql.go Implement Push Notifications (#1842) 2022-03-03 11:40:53 +00:00
sqlite_cgo.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
sqlite_native.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
sqlutil.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
sqlutil_test.go Don't use more than 999 variables in SQLite querys. (#1425) 2020-09-14 16:39:38 +01:00
trace.go Upgrade various dependencies (#2496) 2022-05-26 12:34:43 +01:00
trace_driver.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
trace_driver_wasm.go Run gofmt on dendrite - apply go 1.17 preferred build tags (#2021) 2021-11-02 16:48:48 +00:00
unique_constraint.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
unique_constraint_cgo.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
unique_constraint_wasm.go Fix moderncsqlite errors and rebase onto main (#2832) 2022-11-02 13:20:10 +00:00
uri.go Top-level setup package (#1605) 2020-12-02 17:41:00 +00:00
writer.go Component-wide TransactionWriters (#1290) 2020-08-21 10:42:08 +01:00
writer_dummy.go Component-wide TransactionWriters (#1290) 2020-08-21 10:42:08 +01:00
writer_exclusive.go Update dependencies (#2729) 2022-09-20 15:01:19 +01:00