- docs/database: models, migrations, queries and pagination, relations, casts and validation, attachments and transactions (lagoon.Transaction, lagoon.AfterCommit, nested savepoints, lagoon.OnDatabase) - docs/services: configuration, events, routing with auth groups, rate limiting, authentication, the OAuth server, mail and localization - runnable Examples for lagoon, attach, compass, surf, wire, bouncer, wristband, postcard, phrasebook and festival; lagoon TestDocs* regions run on the package's Postgres harness through DocsDB - 15 new required pages
22 lines
515 B
Go
22 lines
515 B
Go
package lagoon
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
// DocsDB returns a GORM handle on a fresh ICU pl-PL database named name in
|
|
// this package's Postgres harness, for the database-backed docs examples in
|
|
// example_test.go. It skips under -short and fails when the harness has no
|
|
// database, like the package's other database tests.
|
|
func DocsDB(t *testing.T, name string) *gorm.DB {
|
|
t.Helper()
|
|
db, _ := dedicatedDB(t, name)
|
|
gdb, err := Use(t.Context(), db)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return gdb
|
|
}
|