aboutsummaryrefslogtreecommitdiff
path: root/federationsender/storage
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-04-16 10:06:55 +0100
committerGitHub <noreply@github.com>2020-04-16 10:06:55 +0100
commitc1bca95adbe04a17d8feb91aa24dde9c4cffb1fb (patch)
treefca3ee9732ef93a9f8c664956c06de8b4c2c4058 /federationsender/storage
parentc2ea96190944d8e39b0c200e43b1eedfeeeb49a6 (diff)
Add SQL tracing via DENDRITE_TRACE_SQL (#968)
* Add SQL tracing via DENDRITE_TRACE_SQL Add this to `internal/sqlutil` in preparation for #897 * Not entirely
Diffstat (limited to 'federationsender/storage')
-rw-r--r--federationsender/storage/postgres/storage.go3
-rw-r--r--federationsender/storage/sqlite3/storage.go3
2 files changed, 4 insertions, 2 deletions
diff --git a/federationsender/storage/postgres/storage.go b/federationsender/storage/postgres/storage.go
index d97b5d29..b909a189 100644
--- a/federationsender/storage/postgres/storage.go
+++ b/federationsender/storage/postgres/storage.go
@@ -21,6 +21,7 @@ import (
"github.com/matrix-org/dendrite/common"
"github.com/matrix-org/dendrite/federationsender/types"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
)
// Database stores information needed by the federation sender
@@ -35,7 +36,7 @@ type Database struct {
func NewDatabase(dataSourceName string) (*Database, error) {
var result Database
var err error
- if result.db, err = sql.Open("postgres", dataSourceName); err != nil {
+ if result.db, err = sqlutil.Open("postgres", dataSourceName); err != nil {
return nil, err
}
if err = result.prepare(); err != nil {
diff --git a/federationsender/storage/sqlite3/storage.go b/federationsender/storage/sqlite3/storage.go
index 6ab9ae00..458d7d7e 100644
--- a/federationsender/storage/sqlite3/storage.go
+++ b/federationsender/storage/sqlite3/storage.go
@@ -23,6 +23,7 @@ import (
"github.com/matrix-org/dendrite/common"
"github.com/matrix-org/dendrite/federationsender/types"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
)
// Database stores information needed by the federation sender
@@ -37,7 +38,7 @@ type Database struct {
func NewDatabase(dataSourceName string) (*Database, error) {
var result Database
var err error
- if result.db, err = sql.Open(common.SQLiteDriverName(), dataSourceName); err != nil {
+ if result.db, err = sqlutil.Open(common.SQLiteDriverName(), dataSourceName); err != nil {
return nil, err
}
if err = result.prepare(); err != nil {