stdlib

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Copyright 2022 CodeNotary, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrBadQueryString = errors.New("bad query string. use format immudb://username:secret@host:port/db")
View Source
var ErrFloatValuesNotSupported = errors.New("float values are not yet supported by immudb")
View Source
var ErrNotImplemented = errors.New("not implemented")
View Source
var ErrTimeValuesNotSupported = errors.New("time values are not yet supported by immudb")

Functions

func GetUri

func GetUri(o *client.Options) string

func Open added in v1.2.2

func Open(dns string) *sql.DB

func OpenDB

func OpenDB(cliOpts *client.Options) *sql.DB

func ParseConfig

func ParseConfig(uri string) (*client.Options, error)

func RegisterConnConfig added in v1.2.2

func RegisterConnConfig(clientOptions *client.Options) string

RegisterConnConfig registers a ConnConfig and returns the connection string to use with Open.

func RenderValue

func RenderValue(op interface{}) interface{}

func UnregisterConnConfig added in v1.2.2

func UnregisterConnConfig(connStr string)

UnregisterConnConfig removes the ConnConfig registration for connStr.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) Begin

func (c *Conn) Begin() (driver.Tx, error)

func (*Conn) BeginTx

func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)

func (*Conn) CheckNamedValue

func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ExecContext

func (c *Conn) ExecContext(ctx context.Context, query string, argsV []driver.NamedValue) (driver.Result, error)

func (*Conn) GetImmuClient

func (c *Conn) GetImmuClient() client.ImmuClient

Conn returns the underlying client.ImmuClient

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (driver.Stmt, error)

func (*Conn) PrepareContext

func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)

func (*Conn) QueryContext

func (c *Conn) QueryContext(ctx context.Context, query string, argsV []driver.NamedValue) (driver.Rows, error)

func (*Conn) ResetSession

func (c *Conn) ResetSession(ctx context.Context) error

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

func (*Driver) Open

func (d *Driver) Open(name string) (driver.Conn, error)

func (*Driver) OpenConnector

func (d *Driver) OpenConnector(name string) (driver.Connector, error)

type Rows

type Rows struct {
	// contains filtered or unexported fields
}

func (*Rows) Close

func (r *Rows) Close() error

func (*Rows) ColumnTypeDatabaseTypeName

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

ColumnTypeDatabaseTypeName

IntegerType   SQLValueType = "INTEGER"
BooleanType   SQLValueType = "BOOLEAN"
VarcharType   SQLValueType = "VARCHAR"
BLOBType      SQLValueType = "BLOB"
TimestampType SQLValueType = "TIMESTAMP"
AnyType       SQLValueType = "ANY"

func (*Rows) ColumnTypeLength

func (r *Rows) ColumnTypeLength(index int) (int64, bool)

ColumnTypeLength If length is not limited other than system limits, it should return math.MaxInt64

func (*Rows) ColumnTypePrecisionScale

func (r *Rows) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)

ColumnTypePrecisionScale should return the precision and scale for decimal types. If not applicable, variableLength should be false.

func (*Rows) ColumnTypeScanType

func (r *Rows) ColumnTypeScanType(index int) reflect.Type

ColumnTypeScanType returns the value type that can be used to scan types into.

func (*Rows) Columns

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

func (*Rows) Next

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

type RowsAffected added in v1.2.0

type RowsAffected struct {
	// contains filtered or unexported fields
}

RowsAffected implements Result for an INSERT or UPDATE operation which mutates a number of rows.

func (RowsAffected) LastInsertId added in v1.2.0

func (rows RowsAffected) LastInsertId() (int64, error)

func (RowsAffected) RowsAffected added in v1.2.0

func (rows RowsAffected) RowsAffected() (int64, error)

Jump to

Keyboard shortcuts

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