mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: split sql to driver (#2279)
* Add new database interface for SQL operations * Move SQL code of Activity into Database * Rename `Database` into `Driver` * Move SQL code of SystemSetting into Driver * Fix store.New in text code * Change database into driver in the variables * Change sqlite3.New into sqlite3.NewDriver
This commit is contained in:
@ -19,6 +19,7 @@ import (
|
||||
"github.com/usememos/memos/server/profile"
|
||||
"github.com/usememos/memos/store"
|
||||
"github.com/usememos/memos/store/db"
|
||||
"github.com/usememos/memos/store/sqlite3"
|
||||
"github.com/usememos/memos/test"
|
||||
)
|
||||
|
||||
@ -39,7 +40,9 @@ func NewTestingServer(ctx context.Context, t *testing.T) (*TestingServer, error)
|
||||
return nil, errors.Wrap(err, "failed to migrate db")
|
||||
}
|
||||
|
||||
store := store.New(db.DBInstance, profile)
|
||||
driver := sqlite3.NewDriver(db.DBInstance)
|
||||
|
||||
store := store.New(db.DBInstance, driver, profile)
|
||||
server, err := server.NewServer(ctx, profile, store)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to create server")
|
||||
|
Reference in New Issue
Block a user