sql

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name       string
	ServerType string
}

Column is SQL column struct

type Conn

type Conn interface {
	driver.Conn

	CloseQueryContext(ctx context.Context, queryID string) error

	ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)

	FetchContext(ctx context.Context, queryID string, columns []Column) (*ResultSet, error)

	QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
}

Conn extends driver.Conn

type ResultSet

type ResultSet struct {
	Last  bool
	Data  [][]driver.Value
	Index int
}

ResultSet is SQL resultSet struct

func (*ResultSet) GetResultAndMoveNext

func (rs *ResultSet) GetResultAndMoveNext() []driver.Value

GetResultAndMoveNext returns result with index current value and increase index by 1. Note: GetResultAndMoveNext does not check index out of range

type Rows

type Rows struct {
	Connection Conn
	QueryID    string
	ColumnsRaw []Column
	ResultSet  *ResultSet
}

Rows is SQL rows struct

func (*Rows) Close

func (r *Rows) Close() error

Close - see https://golang.org/pkg/database/sql/driver/#Rows for more details

func (*Rows) ColumnTypeDatabaseTypeName

func (r *Rows) ColumnTypeDatabaseTypeName(index int) string

ColumnTypeDatabaseTypeName - see https://golang.org/pkg/database/sql/driver/#RowsColumnTypeDatabaseTypeName for more details

func (*Rows) Columns

func (r *Rows) Columns() []string

Columns - see https://golang.org/pkg/database/sql/driver/#Rows for more details

func (*Rows) Next

func (r *Rows) Next(dest []driver.Value) error

Next - see https://golang.org/pkg/database/sql/driver/#Rows for more details

type Stmt

type Stmt struct {
	Connection Conn
	QueryExp   string
}

Stmt is SQL statement struct

func (*Stmt) Close

func (s *Stmt) Close() error

Close - see https://golang.org/pkg/database/sql/driver/#Stmt for more details

func (*Stmt) Exec

func (s *Stmt) Exec(args []driver.Value) (driver.Result, error)

Exec - see https://golang.org/pkg/database/sql/driver/#Stmt for more details

func (*Stmt) ExecContext

func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error)

ExecContext - see https://golang.org/pkg/database/sql/driver/#StmtExecContext for more details

func (*Stmt) NumInput

func (s *Stmt) NumInput() int

NumInput - see https://golang.org/pkg/database/sql/driver/#Stmt for more details

func (*Stmt) Query

func (s *Stmt) Query(args []driver.Value) (driver.Rows, error)

Query - see https://golang.org/pkg/database/sql/driver/#Stmt for more details

func (*Stmt) QueryContext

func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error)

QueryContext - see https://golang.org/pkg/database/sql/driver/#StmtQueryContext for more details

Directories

Path Synopsis
v1
v2

Jump to

Keyboard shortcuts

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