db

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PGInstance *postgres
)

Functions

func InitializeDatabase

func InitializeDatabase(ctx context.Context, uri string) error

func LogErrorTypeInfo

func LogErrorTypeInfo(err error)

func SaveOrUpdateAerialSprayLine

func SaveOrUpdateAerialSprayLine(ctx context.Context, org *models.Organization, fs []*fslayer.AerialSprayLine) (inserts uint, updates uint, err error)

func SaveOrUpdateAerialSpraySession

func SaveOrUpdateAerialSpraySession(ctx context.Context, org *models.Organization, fs []*fslayer.AerialSpraySession) (inserts uint, updates uint, err error)

func SaveOrUpdateBarrierSpray

func SaveOrUpdateBarrierSpray(ctx context.Context, org *models.Organization, fs []*fslayer.BarrierSpray) (inserts uint, updates uint, err error)

func SaveOrUpdateBarrierSprayRoute

func SaveOrUpdateBarrierSprayRoute(ctx context.Context, org *models.Organization, fs []*fslayer.BarrierSprayRoute) (inserts uint, updates uint, err error)

func SaveOrUpdateContainerRelate

func SaveOrUpdateContainerRelate(ctx context.Context, org *models.Organization, fs []*fslayer.ContainerRelate) (inserts uint, updates uint, err error)

func SaveOrUpdateFieldScoutingLog

func SaveOrUpdateFieldScoutingLog(ctx context.Context, org *models.Organization, fs []*fslayer.FieldScoutingLog) (inserts uint, updates uint, err error)

func SaveOrUpdateHabitatRelate

func SaveOrUpdateHabitatRelate(ctx context.Context, org *models.Organization, fs []*fslayer.HabitatRelate) (inserts uint, updates uint, err error)

func SaveOrUpdateInspectionSample

func SaveOrUpdateInspectionSample(ctx context.Context, org *models.Organization, fs []*fslayer.InspectionSample) (inserts uint, updates uint, err error)

func SaveOrUpdateInspectionSampleDetail

func SaveOrUpdateInspectionSampleDetail(ctx context.Context, org *models.Organization, fs []*fslayer.InspectionSampleDetail) (inserts uint, updates uint, err error)

func SaveOrUpdateLandingCount

func SaveOrUpdateLandingCount(ctx context.Context, org *models.Organization, fs []*fslayer.LandingCount) (inserts uint, updates uint, err error)

func SaveOrUpdateLandingCountLocation

func SaveOrUpdateLandingCountLocation(ctx context.Context, org *models.Organization, fs []*fslayer.LandingCountLocation) (inserts uint, updates uint, err error)

func SaveOrUpdateLineLocation

func SaveOrUpdateLineLocation(ctx context.Context, org *models.Organization, fs []*fslayer.LineLocation) (inserts uint, updates uint, err error)

func SaveOrUpdateLocationTracking

func SaveOrUpdateLocationTracking(ctx context.Context, org *models.Organization, fs []*fslayer.LocationTracking) (inserts uint, updates uint, err error)

func SaveOrUpdateMosquitoInspection

func SaveOrUpdateMosquitoInspection(ctx context.Context, org *models.Organization, fs []*fslayer.MosquitoInspection) (inserts uint, updates uint, err error)

func SaveOrUpdateOfflineMapAreas

func SaveOrUpdateOfflineMapAreas(ctx context.Context, org *models.Organization, fs []*fslayer.OfflineMapAreas) (inserts uint, updates uint, err error)

func SaveOrUpdatePointLocation

func SaveOrUpdatePointLocation(ctx context.Context, org *models.Organization, fs []*fslayer.PointLocation) (inserts uint, updates uint, err error)

func SaveOrUpdatePolygonLocation

func SaveOrUpdatePolygonLocation(ctx context.Context, org *models.Organization, fs []*fslayer.PolygonLocation) (inserts uint, updates uint, err error)

func SaveOrUpdatePool

func SaveOrUpdatePool(ctx context.Context, org *models.Organization, fs []*fslayer.Pool) (inserts uint, updates uint, err error)

func SaveOrUpdatePoolBuffer

func SaveOrUpdatePoolBuffer(ctx context.Context, org *models.Organization, fs []*fslayer.PoolBuffer) (inserts uint, updates uint, err error)

func SaveOrUpdatePoolDetail

func SaveOrUpdatePoolDetail(ctx context.Context, org *models.Organization, fs []*fslayer.PoolDetail) (inserts uint, updates uint, err error)

func SaveOrUpdateProposedTreatmentArea

func SaveOrUpdateProposedTreatmentArea(ctx context.Context, org *models.Organization, fs []*fslayer.ProposedTreatmentArea) (inserts uint, updates uint, err error)

func SaveOrUpdateQALarvCount

func SaveOrUpdateQALarvCount(ctx context.Context, org *models.Organization, fs []*fslayer.QALarvCount) (inserts uint, updates uint, err error)

func SaveOrUpdateQAMosquitoInspection

func SaveOrUpdateQAMosquitoInspection(ctx context.Context, org *models.Organization, fs []*fslayer.QAMosquitoInspection) (inserts uint, updates uint, err error)

func SaveOrUpdateQAProductObservation

func SaveOrUpdateQAProductObservation(ctx context.Context, org *models.Organization, fs []*fslayer.QAProductObservation) (inserts uint, updates uint, err error)

func SaveOrUpdateRestrictedArea

func SaveOrUpdateRestrictedArea(ctx context.Context, org *models.Organization, fs []*fslayer.RestrictedArea) (inserts uint, updates uint, err error)

func SaveOrUpdateRodentInspection

func SaveOrUpdateRodentInspection(ctx context.Context, org *models.Organization, fs []*fslayer.RodentInspection) (inserts uint, updates uint, err error)

func SaveOrUpdateRodentLocation

func SaveOrUpdateRodentLocation(ctx context.Context, org *models.Organization, fs []*fslayer.RodentLocation) (inserts uint, updates uint, err error)

func SaveOrUpdateSampleCollection

func SaveOrUpdateSampleCollection(ctx context.Context, org *models.Organization, fs []*fslayer.SampleCollection) (inserts uint, updates uint, err error)

func SaveOrUpdateSampleLocation

func SaveOrUpdateSampleLocation(ctx context.Context, org *models.Organization, fs []*fslayer.SampleLocation) (inserts uint, updates uint, err error)

func SaveOrUpdateServiceRequest

func SaveOrUpdateServiceRequest(ctx context.Context, org *models.Organization, fs []*fslayer.ServiceRequest) (inserts uint, updates uint, err error)

func SaveOrUpdateSpeciesAbundance

func SaveOrUpdateSpeciesAbundance(ctx context.Context, org *models.Organization, fs []*fslayer.SpeciesAbundance) (inserts uint, updates uint, err error)

func SaveOrUpdateStormDrain

func SaveOrUpdateStormDrain(ctx context.Context, org *models.Organization, fs []*fslayer.StormDrain) (inserts uint, updates uint, err error)

func SaveOrUpdateTimeCard

func SaveOrUpdateTimeCard(ctx context.Context, org *models.Organization, fs []*fslayer.TimeCard) (inserts uint, updates uint, err error)

func SaveOrUpdateTracklog

func SaveOrUpdateTracklog(ctx context.Context, org *models.Organization, fs []*fslayer.Tracklog) (inserts uint, updates uint, err error)

func SaveOrUpdateTrapData

func SaveOrUpdateTrapData(ctx context.Context, org *models.Organization, fs []*fslayer.TrapData) (inserts uint, updates uint, err error)

func SaveOrUpdateTrapLocation

func SaveOrUpdateTrapLocation(ctx context.Context, org *models.Organization, fs []*fslayer.TrapLocation) (inserts uint, updates uint, err error)

func SaveOrUpdateTreatment

func SaveOrUpdateTreatment(ctx context.Context, org *models.Organization, fs []*fslayer.Treatment) (inserts uint, updates uint, err error)

func SaveOrUpdateTreatmentArea

func SaveOrUpdateTreatmentArea(ctx context.Context, org *models.Organization, fs []*fslayer.TreatmentArea) (inserts uint, updates uint, err error)

func SaveOrUpdateULVSprayRoute

func SaveOrUpdateULVSprayRoute(ctx context.Context, org *models.Organization, fs []*fslayer.ULVSprayRoute) (inserts uint, updates uint, err error)

func SaveOrUpdateZones

func SaveOrUpdateZones(ctx context.Context, org *models.Organization, fs []*fslayer.Zones) (inserts uint, updates uint, err error)

func SaveOrUpdateZones2

func SaveOrUpdateZones2(ctx context.Context, org *models.Organization, fs []*fslayer.Zones2) (inserts uint, updates uint, err error)

func TestPreparedQuery

func TestPreparedQuery(ctx context.Context, row *fslayer.RodentLocation) error

func TestPreparedQueryOld

func TestPreparedQueryOld(ctx context.Context) error

Types

type BoolParam

type BoolParam bool

BoolParam wraps a boolean parameter

func Bool

func Bool(b bool) BoolParam

func (BoolParam) ToSql

func (p BoolParam) ToSql() string

type EnumParam

type EnumParam string

EnumParam wraps a PostgreSQL enum parameter

func Enum

func Enum(n string, e Stringable) EnumParam

func (EnumParam) ToSql

func (p EnumParam) ToSql() string

type Float64Param

type Float64Param struct {
	Name  string
	Value float64
}

func Float64

func Float64(n string, f float64) Float64Param

func (Float64Param) ToSql

func (p Float64Param) ToSql() string

type FloatParam

type FloatParam float64

FloatParam wraps a float parameter

func Float

func Float(f float64) FloatParam

func (FloatParam) ToSql

func (p FloatParam) ToSql() string

type GISLineParam

type GISLineParam struct {
	Name  string
	Value GeometryLine
	WKID  int
}

func GISLine

func GISLine(n string, v GeometryLine, wkid int) GISLineParam

func (GISLineParam) ToSql

func (p GISLineParam) ToSql() string

type GISPointParam

type GISPointParam struct {
	Name  string
	Value GeometryPoint
	WKID  int
}

func GISPoint

func GISPoint(n string, v GeometryPoint, wkid int) GISPointParam

func (GISPointParam) ToSql

func (p GISPointParam) ToSql() string

type GISPolygonParam

type GISPolygonParam struct {
	Name  string
	Value GeometryPolygon
	WKID  int
}

func GISPolygon

func GISPolygon(n string, v GeometryPolygon, wkid int) GISPolygonParam

func (GISPolygonParam) ToSql

func (p GISPolygonParam) ToSql() string

type GeometryLine

type GeometryLine struct {
	Paths [][][]float64 `json:"paths"`
}

type GeometryPoint

type GeometryPoint struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
}

type GeometryPolygon

type GeometryPolygon struct {
	Rings [][][]float64 `json:"rings"`
}

type InsertResultRow

type InsertResultRow struct {
	Inserted bool `db:"row_inserted"`
	Version  int  `db:"version_num"`
}

type Int16Param

type Int16Param struct {
	Name  string
	Value int16
}

IntParam wraps an int parameter

func Int16

func Int16(n string, i int16) Int16Param

func (Int16Param) ToSql

func (p Int16Param) ToSql() string

type Int32Param

type Int32Param struct {
	Name  string
	Value int32
}

func Int32

func Int32(n string, i int32) Int32Param

func (Int32Param) ToSql

func (p Int32Param) ToSql() string

type Int64Param

type Int64Param struct {
	Name  string
	Value int64
}

func Int64

func Int64(n string, i int64) Int64Param

func (Int64Param) ToSql

func (p Int64Param) ToSql() string

type JsonBParam

type JsonBParam struct {
	Name  string
	Value json.RawMessage
}

func JsonB

func JsonB(n string, v json.RawMessage) JsonBParam

func (JsonBParam) ToSql

func (p JsonBParam) ToSql() string

type NullParam

type NullParam struct {
	Name string
}

NullParam represents a NULL value

func Null

func Null() NullParam

func (NullParam) ToSql

func (p NullParam) ToSql() string

type SqlParam

type SqlParam interface {
	ToSql() string
}

SqlParam is a generic struct that wraps a parameter with its SQL representation

type StringParam

type StringParam struct {
	Name  string
	Value string
}

StringParam wraps a string parameter

func String

func String(n, s string) StringParam

Convenience functions to create typed parameters

func (StringParam) ToSql

func (p StringParam) ToSql() string

type Stringable

type Stringable interface {
	String() string
}

type TimestampParam

type TimestampParam struct {
	Name  string
	Value time.Time
}

TimestampParam wraps a time.Time parameter for PostgreSQL TIMESTAMP WITHOUT TIME ZONE

func Timestamp

func Timestamp(name string, t time.Time) TimestampParam

Timestamp creates a PostgreSQL TIMESTAMP WITHOUT TIME ZONE parameter

func (TimestampParam) ToSql

func (p TimestampParam) ToSql() string

type TimestamptzParam

type TimestamptzParam time.Time

TimestamptzParam wraps a time.Time parameter for PostgreSQL TIMESTAMP WITH TIME ZONE

func Timestamptz

func Timestamptz(t time.Time) TimestamptzParam

Timestamptz creates a PostgreSQL TIMESTAMP WITH TIME ZONE parameter

func (TimestamptzParam) ToSql

func (p TimestamptzParam) ToSql() string

type UUIDParam

type UUIDParam struct {
	Name  string
	Value string
}

func UUID

func UUID(name string, u uuid.UUID) UUIDParam

func (UUIDParam) ToSql

func (p UUIDParam) ToSql() string

type Uint32Param

type Uint32Param struct {
	Name  string
	Value uint32
}

func Uint32

func Uint32(name string, u uint) Uint32Param

func (Uint32Param) ToSql

func (p Uint32Param) ToSql() string

type Uint64Param

type Uint64Param struct {
	Name  string
	Value uint64
}

func Uint64

func Uint64(name string, u uint64) Uint64Param

func (Uint64Param) ToSql

func (p Uint64Param) ToSql() string

type UintParam

type UintParam struct {
	Name  string
	Value uint
}

UintParam wraps a uint parameter

func Uint

func Uint(name string, u uint) UintParam

func (UintParam) ToSql

func (p UintParam) ToSql() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL