{"modulePath":"github.com/volatiletech/sqlboiler","version":"v3.7.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package types\n\n## Functions\n\n```go\nfunc Array(a interface{}) interface {\n\tdriver.Valuer\n\tsql.Scanner\n}\n```\nArray returns the optimal driver.Valuer and sql.Scanner for an array or slice of any dimension.\n\nFor example:\n\n\tdb.Query(`SELECT * FROM t WHERE id = ANY($1)`, pq.Array([]int{235, 401}))\n\n\tvar x []sql.NullInt64\n\tdb.QueryRow('SELECT ARRAY[235, 401]').Scan(pq.Array(\u0026x))\n\nScanning multi-dimensional arrays is not supported.  Arrays where the lower bound is not one (such as \\`\\[0:0]={1}') are not supported.\n\n```go\nfunc EnableInfinityTs(negative time.Time, positive time.Time)\n```\nEnableInfinityTs controls the handling of Postgres' \"-infinity\" and \"infinity\" \"timestamp\"s.\n\nIf EnableInfinityTs is not called, \"-infinity\" and \"infinity\" will return \\[]byte(\"-infinity\") and \\[]byte(\"infinity\") respectively, and potentially cause error \"sql: Scan error on column index 0: unsupported driver -\u003e Scan pair: \\[]uint8 -\u003e \\*time.Time\", when scanning into a time.Time value.\n\nOnce EnableInfinityTs has been called, all connections created using this driver will decode Postgres' \"-infinity\" and \"infinity\" for \"timestamp\", \"timestamp with time zone\" and \"date\" types to the predefined minimum and maximum times, respectively.  When encoding time.Time values, any time which equals or precedes the predefined minimum time will be encoded to \"-infinity\".  Any values at or past the maximum time will similarly be encoded to \"infinity\".\n\nIf EnableInfinityTs is called with negative \u003e= positive, it will panic. Calling EnableInfinityTs after a connection has been established results in undefined behavior.  If EnableInfinityTs is called more than once, it will panic.\n\n```go\nfunc FormatTimestamp(t time.Time) []byte\n```\nFormatTimestamp formats t into Postgres' text format for timestamps.\n\n```go\nfunc ParseTimestamp(currentLocation *time.Location, str string) (time.Time, error)\n```\nParseTimestamp parses Postgres' text format. It returns a time.Time in currentLocation iff that time's offset agrees with the offset sent from the Postgres server. Otherwise, ParseTimestamp returns a time.Time with the fixed offset offset provided by the Postgres server.\n\n## Types\n\n```go\ntype ArrayDelimiter interface {\n\t// ArrayDelimiter returns the delimiter character(s) for this element's type.\n\tArrayDelimiter() string\n}\n```\nArrayDelimiter may be optionally implemented by driver.Valuer or sql.Scanner to override the array delimiter used by GenericArray.\n\n```go\ntype BoolArray []bool\n```\nBoolArray represents a one-dimensional array of the PostgreSQL boolean type.\n\n```go\nfunc (a *BoolArray) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *BoolArray) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a BoolArray) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n```go\ntype Byte byte\n```\nByte is an alias for byte. Byte implements Marshal and Unmarshal.\n\n```go\nfunc (b Byte) MarshalJSON() ([]byte, error)\n```\nMarshalJSON returns the JSON encoding of b.\n\n```go\nfunc (b *Byte) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (b *Byte) Scan(src interface{}) error\n```\nScan stores the src in \\*b.\n\n```go\nfunc (b Byte) String() string\n```\nString output your byte.\n\n```go\nfunc (b *Byte) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON sets \\*b to a copy of data.\n\n```go\nfunc (b Byte) Value() (driver.Value, error)\n```\nValue returns b as a driver.Value.\n\n```go\ntype BytesArray [][]byte\n```\nBytesArray represents a one-dimensional array of the PostgreSQL bytea type.\n\n```go\nfunc (a *BytesArray) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *BytesArray) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a BytesArray) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface. It uses the \"hex\" format which is only supported on PostgreSQL 9.0 or newer.\n\n```go\ntype Decimal struct {\n\t*decimal.Big\n}\n```\nDecimal is a DECIMAL in sql. Its zero value is valid for use with both Value and Scan.\n\nAlthough decimal can represent NaN and Infinity it will return an error if an attempt to store these values in the database is made.\n\nBecause it cannot be nil, when Big is nil Value() will return \"0\" It will error if an attempt to Scan() a \"null\" value into it.\n\n```go\nfunc NewDecimal(d *decimal.Big) Decimal\n```\nNewDecimal creates a new decimal from a decimal\n\n```go\nfunc (d *Decimal) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize implements sqlboiler's randomize interface\n\n```go\nfunc (d *Decimal) Scan(val interface{}) error\n```\nScan implements sql.Scanner.\n\n```go\nfunc (d *Decimal) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON allows marshalling JSON into a null pointer\n\n```go\nfunc (d Decimal) Value() (driver.Value, error)\n```\nValue implements driver.Valuer.\n\n```go\ntype DecimalArray []Decimal\n```\nDecimalArray represents a one-dimensional array of the decimal type.\n\n```go\nfunc (a *DecimalArray) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *DecimalArray) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a DecimalArray) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n```go\ntype Float64Array []float64\n```\nFloat64Array represents a one-dimensional array of the PostgreSQL double precision type.\n\n```go\nfunc (a *Float64Array) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *Float64Array) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a Float64Array) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n```go\ntype GenericArray struct{ A interface{} }\n```\nGenericArray implements the driver.Valuer and sql.Scanner interfaces for an array or slice of any dimension.\n\n```go\nfunc (a GenericArray) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a GenericArray) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n```go\ntype HStore map[string]null.String\n```\nHStore is a wrapper for transferring HStore values back and forth easily.\n\n```go\nfunc (h *HStore) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (h *HStore) Scan(value interface{}) error\n```\nScan implements the Scanner interface.\n\nNote h is reallocated before the scan to clear existing values. If the hstore column's database value is NULL, then h is set to nil instead.\n\n```go\nfunc (h HStore) Value() (driver.Value, error)\n```\nValue implements the driver Valuer interface. Note if h is nil, the database column value will be set to NULL.\n\n```go\ntype Int64Array []int64\n```\nInt64Array represents a one-dimensional array of the PostgreSQL integer types.\n\n```go\nfunc (a *Int64Array) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *Int64Array) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a Int64Array) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n```go\ntype JSON json.RawMessage\n```\nJSON is an alias for json.RawMessage, which is a \\[]byte underneath. JSON implements Marshal and Unmarshal.\n\n```go\nfunc (j *JSON) Marshal(obj interface{}) error\n```\nMarshal obj into your JSON variable.\n\n```go\nfunc (j JSON) MarshalJSON() ([]byte, error)\n```\nMarshalJSON returns j as the JSON encoding of j.\n\n```go\nfunc (j *JSON) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (j *JSON) Scan(src interface{}) error\n```\nScan stores the src in \\*j.\n\n```go\nfunc (j JSON) String() string\n```\nString output your JSON.\n\n```go\nfunc (j JSON) Unmarshal(dest interface{}) error\n```\nUnmarshal your JSON variable into dest.\n\n```go\nfunc (j *JSON) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON sets \\*j to a copy of data.\n\n```go\nfunc (j JSON) Value() (driver.Value, error)\n```\nValue returns j as a value. Unmarshal into RawMessage for validation.\n\n```go\ntype NullDecimal struct {\n\t*decimal.Big\n}\n```\nNullDecimal is the same as Decimal, but allows the Big pointer to be nil. See docmentation for Decimal for more details.\n\nWhen going into a database, if Big is nil it's value will be \"null\".\n\n```go\nfunc NewNullDecimal(d *decimal.Big) NullDecimal\n```\nNewNullDecimal creates a new null decimal from a decimal\n\n```go\nfunc (n NullDecimal) IsZero() bool\n```\nIsZero implements qmhelper.Nullable\n\n```go\nfunc (n *NullDecimal) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize implements sqlboiler's randomize interface\n\n```go\nfunc (n *NullDecimal) Scan(val interface{}) error\n```\nScan implements sql.Scanner.\n\n```go\nfunc (n *NullDecimal) UnmarshalJSON(data []byte) error\n```\nUnmarshalJSON allows marshalling JSON into a null pointer\n\n```go\nfunc (n NullDecimal) Value() (driver.Value, error)\n```\nValue implements driver.Valuer.\n\n```go\ntype StringArray []string\n```\nStringArray represents a one-dimensional array of the PostgreSQL character types.\n\n```go\nfunc (a *StringArray) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool)\n```\nRandomize for sqlboiler\n\n```go\nfunc (a *StringArray) Scan(src interface{}) error\n```\nScan implements the sql.Scanner interface.\n\n```go\nfunc (a StringArray) Value() (driver.Value, error)\n```\nValue implements the driver.Valuer interface.\n\n","path":"github.com/volatiletech/sqlboiler/types","name":"types","synopsis":"","isRedistributable":true}
