2025-11-04 23:11:32 +00:00
|
|
|
// Code generated by BobGen psql v0.41.1. DO NOT EDIT.
|
|
|
|
|
// This file is meant to be re-generated in place and/or deleted at any time.
|
|
|
|
|
|
|
|
|
|
package factory
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
2025-11-07 09:30:31 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-07 08:34:32 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 23:11:32 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
|
2025-11-07 08:34:32 +00:00
|
|
|
if _, err := New().NewGooseDBVersionWithContext(ctx).Create(ctx, tx); err != nil {
|
|
|
|
|
t.Fatalf("Error creating GooseDBVersion: %v", err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-13 23:48:41 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-07 08:34:32 +00:00
|
|
|
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)
|
2025-11-04 23:11:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-11 20:09:11 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-06 00:23:58 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 23:11:32 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-05 17:15:33 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-13 23:48:41 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-04 23:11:32 +00:00
|
|
|
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)
|
|
|
|
|
}
|
|
|
|
|
}
|