Refactor database code to support standalone batches, transactions.

This is spin-off of changes from #459.

Transactions are not being used yet, but batches are updated to work
with the new API.

`database/` package was refactored to split abstract interfaces and
implementation via goleveldb. This should make it easier to implement
new database types.
This commit is contained in:
Andrey Smirnov authored and Andrey Smirnov committed 2019-08-09 00:46:40 +03:00
1 parent 26098f6c8d
commit 67e38955ae
23 files changed
+539 -315

No files matched your search

+2 -1
View File
@@ -7,6 +7,7 @@ import (
"github.com/aptly-dev/aptly/aptly"
"github.com/aptly-dev/aptly/console"
"github.com/aptly-dev/aptly/database"
"github.com/aptly-dev/aptly/database/goleveldb"
"github.com/aptly-dev/aptly/files"
"github.com/aptly-dev/aptly/utils"
@@ -37,7 +38,7 @@ func (s *ChangesSuite) SetUpTest(c *C) {
err := utils.CopyFile("testdata/changes/calamares.changes", s.Path)
c.Assert(err, IsNil)
s.db, _ = database.NewOpenDB(c.MkDir())
s.db, _ = goleveldb.NewOpenDB(c.MkDir())
s.localRepoCollection = NewLocalRepoCollection(s.db)
s.packageCollection = NewPackageCollection(s.db)