Add sqlite3 connect in memory with debug fn

This commit is contained in:
Denis Arh
2020-09-30 12:29:44 +02:00
parent 4c45aa6d1a
commit f831a665eb
+4
View File
@@ -58,6 +58,10 @@ func ConnectInMemory(ctx context.Context) (s store.Storer, err error) {
return Connect(ctx, "sqlite3://file::memory:?cache=shared&mode=memory")
}
func ConnectInMemoryWithDebug(ctx context.Context) (s store.Storer, err error) {
return Connect(ctx, "sqlite3+debug://file::memory:?cache=shared&mode=memory")
}
func (s *Store) Upgrade(ctx context.Context, log *zap.Logger) (err error) {
if err = (&rdbms.Schema{}).Upgrade(ctx, NewUpgrader(log, s)); err != nil {
return fmt.Errorf("can not upgrade sqlite schema: %w", err)