2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-12-05 09:35:50 +00:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package satellitedb
|
|
|
|
|
2018-12-07 14:46:42 +00:00
|
|
|
import (
|
|
|
|
"github.com/zeebo/errs"
|
|
|
|
)
|
|
|
|
|
2018-12-17 20:14:16 +00:00
|
|
|
//go:generate dbx.v1 schema -d postgres -d sqlite3 satellitedb.dbx .
|
|
|
|
//go:generate dbx.v1 golang -d postgres -d sqlite3 satellitedb.dbx .
|
|
|
|
|
2018-12-07 14:46:42 +00:00
|
|
|
func init() {
|
|
|
|
// catch dbx errors
|
|
|
|
c := errs.Class("satellitedb")
|
2018-12-17 20:14:16 +00:00
|
|
|
WrapErr = func(e *Error) error {
|
|
|
|
if e.Code == ErrorCode_NoRows {
|
|
|
|
return e.Err
|
|
|
|
}
|
|
|
|
return c.Wrap(e)
|
|
|
|
}
|
2018-12-07 14:46:42 +00:00
|
|
|
}
|