1. 1
  1.  

  2. 1

    Wrap each test in a transaction: Works fine as long as none of your code uses transactions as Postgres can’t nest transactions.

    You just inherit the transaction in a test. (tf conn.Tx != nil return conn.Tx etc.) Not that hard.

    1. 1

      When I started out in this industry I worked for a multi-site ecommerce company, postgres search paths were a big part of their strategy. Periodically the backend tables would get queried and they’d generate a bunch of tables like $site1.products or $site2.categories.

      Seems like a reasonable idea for integration tests.