pgsqldriver

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2020 License: MIT Imports: 16 Imported by: 1

Documentation

Overview

Package pgsqldriver contains the types for schema 'public'.

Package pgsqldriver contains the types for schema 'public'.

Package pgsqldriver contains the types for schema 'public'.

Package pgsqldriver contains the types for schema 'public'.

Index

Constants

View Source
const (
	// AcquisitionprovenanceModalitySensed is the 'sensed' AcquisitionprovenanceModality.
	AcquisitionprovenanceModalitySensed = AcquisitionprovenanceModality(1)

	// AcquisitionprovenanceModalitySelfReported is the 'self-reported' AcquisitionprovenanceModality.
	AcquisitionprovenanceModalitySelfReported = AcquisitionprovenanceModality(2)

	AcquisitionprovenanceModalityComputed = AcquisitionprovenanceModality(3)
)

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

func New

func New(host string, port uint, user string, password string, dbname string) (*sql.DB, error)

New created a new database connection.

func OmhToSQL

func OmhToSQL(src *omh.DataPoint, dst *Datapoint) error

OmhToSQL convert an OMH JSON datapoint to SQL

func SQLToOmh

func SQLToOmh(src *Datapoint, dst *omh.DataPoint) error

SQLToOmh convert a SQL datapoint to a OMH Compatible Datapoint

Types

type AcquisitionprovenanceModality

type AcquisitionprovenanceModality uint16

AcquisitionprovenanceModality is the 'acquisitionprovenance_modality' enum type from schema 'public'.

func (AcquisitionprovenanceModality) MarshalText

func (am AcquisitionprovenanceModality) MarshalText() ([]byte, error)

MarshalText marshals AcquisitionprovenanceModality into text.

func (*AcquisitionprovenanceModality) Scan

func (am *AcquisitionprovenanceModality) Scan(src interface{}) error

Scan satisfies the database/sql.Scanner interface for AcquisitionprovenanceModality.

func (AcquisitionprovenanceModality) String

String returns the string value of the AcquisitionprovenanceModality.

func (*AcquisitionprovenanceModality) UnmarshalText

func (am *AcquisitionprovenanceModality) UnmarshalText(text []byte) error

UnmarshalText unmarshals AcquisitionprovenanceModality from text.

func (AcquisitionprovenanceModality) Value

Value satisfies the sql/driver.Valuer interface for AcquisitionprovenanceModality.

type Datapoint

type Datapoint struct {
	Sk                                          int64                         `json:"sk"`                                           // sk
	Oid                                         string                        `json:"oid"`                                          // oid
	Owner                                       string                        `json:"owner"`                                        // owner
	Created                                     time.Time                     `json:"created"`                                      // created
	Modified                                    time.Time                     `json:"modified"`                                     // modified
	Effective                                   time.Time                     `json:"effective"`                                    // effective
	Timezone                                    string                        `json:"timezone"`                                     // timezone
	Timeoffset                                  int                           `json:"timeoffset"`                                   // timeoffset
	SchemaNamespace                             string                        `json:"schema_namespace"`                             // schema_namespace
	SchemaName                                  string                        `json:"schema_name"`                                  // schema_name
	SchemaVersionMajor                          int                           `json:"schema_version_major"`                         // schema_version_major
	SchemaVersionMinor                          int                           `json:"schema_version_minor"`                         // schema_version_minor
	SchemaVersionPatch                          int                           `json:"schema_version_patch"`                         // schema_version_patch
	AcquisitionprovenanceSourcename             string                        `json:"acquisitionprovenance_sourcename"`             // acquisitionprovenance_sourcename
	AcquisitionprovenanceSourcecreationdatetime time.Time                     `json:"acquisitionprovenance_sourcecreationdatetime"` // acquisitionprovenance_sourcecreationdatetime
	AcquisitionprovenanceModality               AcquisitionprovenanceModality `json:"acquisitionprovenance_modality"`               // acquisitionprovenance_modality
	Additionalproperties                        JSON                          `json:"additionalproperties"`                         // additionalproperties
	Body                                        JSON                          `json:"body"`                                         // body
	// contains filtered or unexported fields
}

Datapoint represents a row from 'public.datapoints'.

func DatapointByOidOwner

func DatapointByOidOwner(db XODB, oid string, owner string) (*Datapoint, error)

DatapointByOidOwner retrieves a row from 'public.datapoints' as a Datapoint.

Generated from index 'datapoints_oid_owner_key'.

func DatapointBySk

func DatapointBySk(db XODB, sk int64) (*Datapoint, error)

DatapointBySk retrieves a row from 'public.datapoints' as a Datapoint.

Generated from index 'datapoints_pkey'.

func (*Datapoint) Delete

func (d *Datapoint) Delete(db XODB) error

Delete deletes the Datapoint from the database.

func (*Datapoint) Deleted

func (d *Datapoint) Deleted() bool

Deleted provides information if the Datapoint has been deleted from the database.

func (*Datapoint) Exists

func (d *Datapoint) Exists() bool

Exists determines if the Datapoint exists in the database.

func (*Datapoint) Insert

func (d *Datapoint) Insert(db XODB) error

Insert inserts the Datapoint to the database.

func (*Datapoint) Save

func (d *Datapoint) Save(db XODB) error

Save saves the Datapoint to the database.

func (*Datapoint) Update

func (d *Datapoint) Update(db XODB) error

Update updates the Datapoint in the database.

func (*Datapoint) Upsert

func (d *Datapoint) Upsert(db XODB) error

Upsert performs an upsert for Datapoint.

NOTE: PostgreSQL 9.5+ only

type GooseDbVersion

type GooseDbVersion struct {
	ID        int         `json:"id"`         // id
	VersionID int64       `json:"version_id"` // version_id
	IsApplied bool        `json:"is_applied"` // is_applied
	Tstamp    pq.NullTime `json:"tstamp"`     // tstamp
	// contains filtered or unexported fields
}

GooseDbVersion represents a row from 'public.goose_db_version'.

func GooseDbVersionByID

func GooseDbVersionByID(db XODB, id int) (*GooseDbVersion, error)

GooseDbVersionByID retrieves a row from 'public.goose_db_version' as a GooseDbVersion.

Generated from index 'goose_db_version_pkey'.

func (*GooseDbVersion) Delete

func (gdv *GooseDbVersion) Delete(db XODB) error

Delete deletes the GooseDbVersion from the database.

func (*GooseDbVersion) Deleted

func (gdv *GooseDbVersion) Deleted() bool

Deleted provides information if the GooseDbVersion has been deleted from the database.

func (*GooseDbVersion) Exists

func (gdv *GooseDbVersion) Exists() bool

Exists determines if the GooseDbVersion exists in the database.

func (*GooseDbVersion) Insert

func (gdv *GooseDbVersion) Insert(db XODB) error

Insert inserts the GooseDbVersion to the database.

func (*GooseDbVersion) Save

func (gdv *GooseDbVersion) Save(db XODB) error

Save saves the GooseDbVersion to the database.

func (*GooseDbVersion) Update

func (gdv *GooseDbVersion) Update(db XODB) error

Update updates the GooseDbVersion in the database.

func (*GooseDbVersion) Upsert

func (gdv *GooseDbVersion) Upsert(db XODB) error

Upsert performs an upsert for GooseDbVersion.

NOTE: PostgreSQL 9.5+ only

type JSON

type JSON string

JSON type is handled as string

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

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