mysqldriver

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package mysqldriver contains the types for schema 'dsu'.

Package mysqldriver contains the types for schema 'dsu'.

Package mysqldriver contains the types for schema 'dsu'.

Package mysqldriver contains the types for schema 'dsu'.

Index

Constants

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

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

Variables

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

XOLog provides the log func used by generated queries.

Functions

func GorpInserter

func GorpInserter(db *gorp.DbMap) gin.HandlerFunc

GorpInserter is a gin middleware that will insert a Gorp DbMao into the context.

func New

func New(host string, port uint, user string, password string, dbname string) (*gorp.DbMap, error)

New created a new database connection.

func OmhToSQL

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

OmhToSQL convert an OMH JSON datapoint to SQL

func SQLToOmh

func SQLToOmh(src *Datapoint, dst *models.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 'dsu'.

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                                          uint64                        `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                          int16                         `json:"schema_version_major"`                         // schema_version_major
	SchemaVersionMinor                          int16                         `json:"schema_version_minor"`                         // schema_version_minor
	SchemaVersionPatch                          int16                         `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                        string                        `json:"additionalproperties"`                         // additionalproperties
	Body                                        string                        `json:"body"`                                         // body
	// contains filtered or unexported fields
}

Datapoint represents a row from 'dsu.datapoints'.

func DatapointByOidOwner

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

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

Generated from index 'oid'.

func DatapointBySk

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

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

Generated from index 'datapoints_sk_pkey'.

func DatapointBySk2

func DatapointBySk2(db XODB, sk uint64) (*Datapoint, error)

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

Generated from index 'sk'.

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.

type GooseDbVersion

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

GooseDbVersion represents a row from 'dsu.goose_db_version'.

func GooseDbVersionByID

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

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

Generated from index 'goose_db_version_id_pkey'.

func GooseDbVersionByID2

func GooseDbVersionByID2(db XODB, id uint64) (*GooseDbVersion, error)

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

Generated from index 'id'.

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.

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 'dsu'.

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