This is an intermediate step between shifting from the old fs_* prefixed table names to an entire fieldseeker schema. At this point we have both, and we aren't doing much with the new schema but compiling.
2169 lines
50 KiB
Go
2169 lines
50 KiB
Go
// Code generated by BobGen psql v0.42.0. DO NOT EDIT.
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
package factory
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateFieldseekerContainerrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerContainerrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerContainerrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerFieldscoutinglog(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerFieldscoutinglogWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerFieldscoutinglog: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerHabitatrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerHabitatrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerHabitatrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerInspectionsample(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerInspectionsampleWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerInspectionsample: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerInspectionsampledetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerInspectionsampledetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerInspectionsampledetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerLinelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerLinelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerLinelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerLocationtracking(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerLocationtrackingWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerLocationtracking: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerMosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerMosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerMosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerPointlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerPointlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerPointlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerPolygonlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerPolygonlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerPolygonlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerPool(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerPoolWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerPool: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerPooldetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerPooldetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerPooldetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerProposedtreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerProposedtreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerProposedtreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerQamosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerQamosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerQamosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerRodentlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerRodentlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerRodentlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerSamplecollection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerSamplecollectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerSamplecollection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerSamplelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerSamplelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerSamplelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerServicerequest(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerServicerequestWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerServicerequest: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerSpeciesabundance(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerSpeciesabundanceWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerSpeciesabundance: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerStormdrain(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerStormdrainWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerStormdrain: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerTimecard(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerTimecardWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerTimecard: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerTrapdatum(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerTrapdatumWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerTrapdatum: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerTraplocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerTraplocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerTraplocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerTreatment(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerTreatmentWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerTreatment: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerTreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerTreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerTreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerZone(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerZoneWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerZone: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerZones2(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerZones2WithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerZones2: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFieldseekerSync(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFieldseekerSyncWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FieldseekerSync: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSContainerrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSContainerrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSContainerrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSFieldscoutinglog(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSFieldscoutinglogWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSFieldscoutinglog: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSHabitatrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSHabitatrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSHabitatrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSInspectionsample(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSInspectionsampleWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSInspectionsample: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSInspectionsampledetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSInspectionsampledetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSInspectionsampledetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSLinelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSLinelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSLinelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSLocationtracking(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSLocationtrackingWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSLocationtracking: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSMosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSMosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSMosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSPointlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSPointlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSPointlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSPolygonlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSPolygonlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSPolygonlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSPool(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSPoolWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSPool: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSPooldetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSPooldetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSPooldetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSProposedtreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSProposedtreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSProposedtreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSQamosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSQamosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSQamosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSRodentlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSRodentlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSRodentlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSSamplecollection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSSamplecollectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSSamplecollection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSSamplelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSSamplelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSSamplelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSServicerequest(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSServicerequestWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSServicerequest: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSSpeciesabundance(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSSpeciesabundanceWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSSpeciesabundance: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSStormdrain(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSStormdrainWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSStormdrain: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSTimecard(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSTimecardWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSTimecard: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSTrapdatum(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSTrapdatumWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSTrapdatum: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSTraplocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSTraplocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSTraplocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSTreatment(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSTreatmentWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSTreatment: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSTreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSTreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSTreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSZone(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSZoneWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSZone: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateFSZones2(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewFSZones2WithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating FSZones2: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateGooseDBVersion(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewGooseDBVersionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating GooseDBVersion: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateH3Aggregation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewH3AggregationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating H3Aggregation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryContainerrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryContainerrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryContainerrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryFieldscoutinglog(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryFieldscoutinglogWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryFieldscoutinglog: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryHabitatrelate(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryHabitatrelateWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryHabitatrelate: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryInspectionsample(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryInspectionsampleWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryInspectionsample: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryInspectionsampledetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryInspectionsampledetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryInspectionsampledetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryLinelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryLinelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryLinelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryLocationtracking(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryLocationtrackingWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryLocationtracking: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryMosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryMosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryMosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryPointlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryPointlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryPointlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryPolygonlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryPolygonlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryPolygonlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryPool(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryPoolWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryPool: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryPooldetail(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryPooldetailWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryPooldetail: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryProposedtreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryProposedtreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryProposedtreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryQamosquitoinspection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryQamosquitoinspectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryQamosquitoinspection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryRodentlocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryRodentlocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryRodentlocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistorySamplecollection(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistorySamplecollectionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistorySamplecollection: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistorySamplelocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistorySamplelocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistorySamplelocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryServicerequest(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryServicerequestWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryServicerequest: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistorySpeciesabundance(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistorySpeciesabundanceWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistorySpeciesabundance: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryStormdrain(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryStormdrainWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryStormdrain: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryTimecard(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryTimecardWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryTimecard: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryTrapdatum(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryTrapdatumWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryTrapdatum: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryTraplocation(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryTraplocationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryTraplocation: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryTreatment(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryTreatmentWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryTreatment: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryTreatmentarea(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryTreatmentareaWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryTreatmentarea: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryZone(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryZoneWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryZone: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHistoryZones2(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewHistoryZones2WithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating HistoryZones2: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNotification(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewNotificationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating Notification: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateOauthToken(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewOauthTokenWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating OauthToken: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateOrganization(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewOrganizationWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating Organization: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateSession(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewSessionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating Session: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateSpatialRefSy(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewSpatialRefSyWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating SpatialRefSy: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateUser(t *testing.T) {
|
|
if testDB == nil {
|
|
t.Skip("skipping test, no DSN provided")
|
|
}
|
|
|
|
ctx, cancel := context.WithCancel(t.Context())
|
|
t.Cleanup(cancel)
|
|
|
|
tx, err := testDB.Begin(ctx)
|
|
if err != nil {
|
|
t.Fatalf("Error starting transaction: %v", err)
|
|
}
|
|
|
|
defer func() {
|
|
if err := tx.Rollback(ctx); err != nil {
|
|
t.Fatalf("Error rolling back transaction: %v", err)
|
|
}
|
|
}()
|
|
|
|
if _, err := New().NewUserWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating User: %v", err)
|
|
}
|
|
}
|