Documentation ¶ Overview ¶ Package testdb gives DB-backed tests a throwaway Postgres schema loaded with a synthetic fixture. Tests are skipped when AFC_TEST_DB is unset. Index ¶ func Open(t *testing.T) (*sqlx.DB, string) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Open ¶ func Open(t *testing.T) (*sqlx.DB, string) Open creates a uniquely named schema in the AFC_TEST_DB database, loads schema.sql and seed.sql into it, and returns a connection plus a DSN whose search_path points at that schema. The schema is dropped when the test ends. Types ¶ This section is empty. Source Files ¶ View all Source files testdb.go Click to show internal directories. Click to hide internal directories.