1065 lines
25 KiB
Go
1065 lines
25 KiB
Go
// Code generated by BobGen psql v0.0.4-0.20260105020634-53e08d840e47+dirty. 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 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 TestCreateNoteAudio(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().NewNoteAudioWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteAudio: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNoteAudioBreadcrumb(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().NewNoteAudioBreadcrumbWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteAudioBreadcrumb: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNoteAudioDatum(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().NewNoteAudioDatumWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteAudioDatum: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNoteImage(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().NewNoteImageWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteImage: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNoteImageBreadcrumb(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().NewNoteImageBreadcrumbWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteImageBreadcrumb: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreateNoteImageDatum(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().NewNoteImageDatumWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating NoteImageDatum: %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 TestCreatePublicreportQuick(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().NewPublicreportQuickWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating PublicreportQuick: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCreatePublicreportQuickPhoto(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().NewPublicreportQuickPhotoWithContext(ctx).Create(ctx, tx); err != nil {
|
|
t.Fatalf("Error creating PublicreportQuickPhoto: %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)
|
|
}
|
|
}
|