Documentation
¶
Index ¶
- func CopyTestFeed(t testing.TB, tx *sqlx.Tx, reader adapters.Reader) int
- func CreateTestFeed(atx tldb.Adapter, url string) dmfr.Feed
- func CreateTestFeedVersion(atx tldb.Adapter, file string) dmfr.FeedVersion
- func MustFind(atx tldb.Adapter, ent interface{})
- func MustGet(atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})
- func MustInsert(atx tldb.Adapter, ent interface{}) int
- func MustOpenWriter(dburl string, create bool) *tldb.Writer
- func MustSelect(atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})
- func MustUpdate(atx tldb.Adapter, ent interface{}, columns ...string)
- func ShouldFind(t *testing.T, atx tldb.Adapter, ent interface{})
- func ShouldGet(t *testing.T, atx tldb.Adapter, ent interface{}, qstr string, ...)
- func ShouldInsert(t *testing.T, atx tldb.Adapter, ent interface{}) int
- func ShouldSelect(t *testing.T, atx tldb.Adapter, ent interface{}, qstr string, ...)
- func ShouldUpdate(t *testing.T, atx tldb.Adapter, ent interface{}, columns ...string)
- func TempPostgres(dburl string, cb func(tldb.Adapter) error) error
- func TempPostgresRollback(t testing.TB, dburl string, cb func(tldb.Adapter))
- func TempSqlite(cb func(tldb.Adapter) error) error
- func TempSqliteAdapter() tldb.Adapter
- type AdapterIgnoreTx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyTestFeed ¶ added in v1.4.0
CopyTestFeed copies a feed into a new feed version within tx, deduplicating journey patterns as the server's imports do, and returns the feed version's id.
func CreateTestFeed ¶ added in v0.8.0
CreateTestFeed returns a simple feed inserted into a database.
func CreateTestFeedVersion ¶ added in v1.4.0
func CreateTestFeedVersion(atx tldb.Adapter, file string) dmfr.FeedVersion
CreateTestFeedVersion inserts a feed version and its owning feed into a database, returning the feed version.
The feed is named uniquely per call: TempPostgres commits and current_feeds.onestop_id is unique, so a stable name would wedge reruns.
func MustInsert ¶
MustInsert panics on failure
func MustSelect ¶
MustSelect panics on failure
func MustUpdate ¶
MustUpdate panics on failure
func ShouldFind ¶
ShouldFind sends a test error on failure
func ShouldInsert ¶
ShouldInsert sends a test error on failure
func ShouldSelect ¶
func ShouldSelect(t *testing.T, atx tldb.Adapter, ent interface{}, qstr string, qargs ...interface{})
ShouldSelect sends a test error on failure
func ShouldUpdate ¶
ShouldUpdate sends a test error on failure
func TempPostgres ¶ added in v0.18.0
func TempPostgresRollback ¶ added in v1.4.1
TempPostgresRollback runs cb in a transaction on the Postgres database at dburl, and rolls the transaction back when the test ends.
func TempSqlite ¶ added in v0.11.0
TempSqlite creates a temporary in-memory database and runs the callback inside a tx.