sqlx

package module
v0.0.0-...-447debe Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 8 Imported by: 0

README

Extends database/sql package

Build Status Coverage Status Go Report Card GoDoc

Installation

go get -u github.com/tomi77/go-sqlx

Usage

import sqlx "github.com/tomi77/go-sqlx"

type Tab struct {
  ID    uint32
  Value sqlx.NullInt8
}

Documentation

Overview

Package sqlx extends package database/sql

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	Duration time.Duration
}

Duration represents an time.Duration that not may be null. Duration implements the Scanner interface so it can be used as a scan destination.

func (*Duration) Scan

func (d *Duration) Scan(value interface{}) error

Scan implements the Scanner interface.

func (Duration) Value

func (d Duration) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullByte

type NullByte struct {
	Byte  byte
	Valid bool // Valid is true if Byte is not NULL
}

NullByte represents an byte that may be null. NullByte implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullByte) Scan

func (n *NullByte) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullByte) Value

func (n NullByte) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDate

type NullDate struct {
	Date  time.Time
	Valid bool // Valid is true if Date is not NULL
}

NullDate represents an time.Time that may be null. NullDate implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullDate) Scan

func (n *NullDate) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDate) Value

func (n NullDate) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDateTime

type NullDateTime struct {
	DateTime time.Time
	Valid    bool // Valid is true if DateTime is not NULL
}

NullDateTime represents an time.Time that may be null. NullDateTime implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullDateTime) Scan

func (n *NullDateTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDateTime) Value

func (n NullDateTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullDuration

type NullDuration struct {
	Duration time.Duration
	Valid    bool // Valid is true if Duration is not NULL
}

NullDuration represents an time.Duration that may be null. NullDuration implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullDuration) Scan

func (n *NullDuration) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDuration) Value

func (n NullDuration) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullFloat32

type NullFloat32 struct {
	Float32 float32
	Valid   bool // Valid is true if Float32 is not NULL
}

NullFloat32 represents an int32 that may be null. NullFloat32 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullFloat32) Scan

func (n *NullFloat32) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullFloat32) Value

func (n NullFloat32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInt

type NullInt struct {
	Int   int
	Valid bool // Valid is true if Int is not NULL
}

NullInt represents an int that may be null. NullInt implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullInt) Scan

func (n *NullInt) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInt) Value

func (n NullInt) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInt16

type NullInt16 struct {
	Int16 int16
	Valid bool // Valid is true if Int16 is not NULL
}

NullInt16 represents an int16 that may be null. NullInt16 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullInt16) Scan

func (n *NullInt16) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInt16) Value

func (n NullInt16) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInt32

type NullInt32 struct {
	Int32 int32
	Valid bool // Valid is true if Int32 is not NULL
}

NullInt32 represents an int32 that may be null. NullInt32 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullInt32) Scan

func (n *NullInt32) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInt32) Value

func (n NullInt32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullInt8

type NullInt8 struct {
	Int8  int8
	Valid bool // Valid is true if Int8 is not NULL
}

NullInt8 represents an int8 that may be null. NullInt8 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullInt8) Scan

func (n *NullInt8) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullInt8) Value

func (n NullInt8) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRune

type NullRune struct {
	Rune  rune
	Valid bool // Valid is true if Rune is not NULL
}

NullRune represents an rune that may be null. NullRune implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullRune) Scan

func (n *NullRune) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRune) Value

func (n NullRune) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUint

type NullUint struct {
	Uint  uint
	Valid bool // Valid is true if Uint is not NULL
}

NullUint represents an uint that may be null. NullUint implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint) Scan

func (n *NullUint) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint) Value

func (n NullUint) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUint16

type NullUint16 struct {
	Uint16 uint16
	Valid  bool // Valid is true if Uint16 is not NULL
}

NullUint16 represents an uint16 that may be null. NullUint16 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint16) Scan

func (n *NullUint16) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint16) Value

func (n NullUint16) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUint32

type NullUint32 struct {
	Uint32 uint32
	Valid  bool // Valid is true if Uint32 is not NULL
}

NullUint32 represents an uint32 that may be null. NullUint32 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint32) Scan

func (n *NullUint32) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint32) Value

func (n NullUint32) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUint64

type NullUint64 struct {
	Uint64 uint64
	Valid  bool // Valid is true if Uint64 is not NULL
}

NullUint64 represents an uint64 that may be null. NullUint64 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint64) Scan

func (n *NullUint64) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint64) Value

func (n NullUint64) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUint8

type NullUint8 struct {
	Uint8 uint8
	Valid bool // Valid is true if Uint8 is not NULL
}

NullUint8 represents an uint8 that may be null. NullUint8 implements the Scanner interface so it can be used as a scan destination, similar to NullString.

func (*NullUint8) Scan

func (n *NullUint8) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUint8) Value

func (n NullUint8) Value() (driver.Value, error)

Value implements the driver Valuer interface.

Directories

Path Synopsis
Package pgx contains PostgreSQL specific extensions
Package pgx contains PostgreSQL specific extensions

Jump to

Keyboard shortcuts

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