mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-11-28 06:58:53 +01:00
sdk/hints: adapt sqlite to also support postgres.
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/nbd-wtf/go-nostr/sdk/hints/sqlite"
|
||||
"github.com/nbd-wtf/go-nostr/sdk/hints/sqlh"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -16,12 +16,12 @@ func TestSQLiteHintsMattn(t *testing.T) {
|
||||
path := "/tmp/tmpsdkhintssqlite"
|
||||
os.RemoveAll(path)
|
||||
|
||||
db, err := sqlx.Connect("sqlite3", path)
|
||||
db, err := sql.Open("sqlite3", path)
|
||||
|
||||
require.NoError(t, err, "failed to create sqlitehints db")
|
||||
db.SetMaxOpenConns(1)
|
||||
|
||||
sh, err := sqlite.NewSQLiteHints(db)
|
||||
sh, err := sqlh.NewSQLHints(db, "sqlite3")
|
||||
require.NoError(t, err, "failed to setup sqlitehints db")
|
||||
|
||||
runTestWith(t, sh)
|
||||
|
||||
Reference in New Issue
Block a user