-
Notifications
You must be signed in to change notification settings - Fork 567
/
transactiondb.go
37 lines (32 loc) · 1.08 KB
/
transactiondb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Package transactiondb contains the database schema that Pachyderm
// transactions use.
package transactiondb
import (
col "github.com/pachyderm/pachyderm/v2/src/internal/collection"
"github.com/pachyderm/pachyderm/v2/src/internal/pachsql"
"github.com/pachyderm/pachyderm/v2/src/transaction"
)
const (
transactionsCollectionName = "transactions"
)
var transactionsIndexes = []*col.Index{}
// Transactions returns a collection of open transactions
func Transactions(db *pachsql.DB, listener col.PostgresListener) col.PostgresCollection {
return col.NewPostgresCollection(
transactionsCollectionName,
db,
listener,
&transaction.TransactionInfo{},
transactionsIndexes,
)
}
// AllCollections returns a list of all the Transaction API collections for
// postgres-initialization purposes. These collections are not usable for
// querying.
// DO NOT MODIFY THIS FUNCTION
// IT HAS BEEN USED IN A RELEASED MIGRATION
func CollectionsV0() []col.PostgresCollection {
return []col.PostgresCollection{
col.NewPostgresCollection(transactionsCollectionName, nil, nil, nil, transactionsIndexes),
}
}