Documentation
¶
Overview ¶
Copyright 2021 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 ¶
- Variables
- func GetUri(o *client.Options) string
- func OpenDB(cliOpts *client.Options) *sql.DB
- func ParseConfig(uri string) (*client.Options, error)
- func RenderValue(op interface{}) interface{}
- type Conn
- func (c *Conn) Begin() (driver.Tx, error)
- func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error
- func (c *Conn) Close() error
- func (c *Conn) ExecContext(ctx context.Context, query string, argsV []driver.NamedValue) (driver.Result, error)
- func (c *Conn) GetDriver() *Driver
- func (c *Conn) GetImmuClient() client.ImmuClient
- func (c *Conn) Prepare(query string) (driver.Stmt, error)
- func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error)
- func (c *Conn) QueryContext(ctx context.Context, query string, argsV []driver.NamedValue) (driver.Rows, error)
- func (c *Conn) ResetSession(ctx context.Context) error
- type Driver
- func (d *Driver) GetNewConnByOptions(ctx context.Context, cliOptions *client.Options) (*Conn, error)
- func (d *Driver) Open(name string) (driver.Conn, error)
- func (d *Driver) OpenConnector(name string) (driver.Connector, error)
- func (d *Driver) RegisterConnection(cn *Conn) string
- func (d *Driver) UnregisterConnection(name string)
- type Rows
- func (r *Rows) Close() error
- func (r *Rows) ColumnTypeDatabaseTypeName(index int) string
- func (r *Rows) ColumnTypeLength(index int) (int64, bool)
- func (r *Rows) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool)
- func (r *Rows) ColumnTypeScanType(index int) reflect.Type
- func (r *Rows) Columns() []string
- func (r *Rows) Next(dest []driver.Value) error
- type RowsAffected
Constants ¶
This section is empty.
Variables ¶
var ErrBadQueryString = errors.New("bad query string. use format immudb://username:secret@host:port/db")
var ErrFloatValuesNotSupported = errors.New("float values are not yet supported by immudb")
var ErrNotImplemented = errors.New("not implemented")
var ErrTimeValuesNotSupported = errors.New("time values are not yet supported by immudb")
Functions ¶
func RenderValue ¶
func RenderValue(op interface{}) interface{}
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CheckNamedValue ¶
func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error
func (*Conn) ExecContext ¶
func (*Conn) GetImmuClient ¶
func (c *Conn) GetImmuClient() client.ImmuClient
Conn returns the underlying client.ImmuClient
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) GetNewConnByOptions ¶ added in v1.2.0
func (*Driver) OpenConnector ¶
func (*Driver) RegisterConnection ¶ added in v1.2.0
func (*Driver) UnregisterConnection ¶ added in v1.2.0
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) ColumnTypeDatabaseTypeName ¶
ColumnTypeDatabaseTypeName
IntegerType SQLValueType = "INTEGER" BooleanType SQLValueType = "BOOLEAN" VarcharType SQLValueType = "VARCHAR" BLOBType SQLValueType = "BLOB" TimestampType SQLValueType = "TIMESTAMP" AnyType SQLValueType = "ANY"
func (*Rows) ColumnTypeLength ¶
ColumnTypeLength If length is not limited other than system limits, it should return math.MaxInt64
func (*Rows) ColumnTypePrecisionScale ¶
ColumnTypePrecisionScale should return the precision and scale for decimal types. If not applicable, variableLength should be false.
func (*Rows) ColumnTypeScanType ¶
ColumnTypeScanType returns the value type that can be used to scan types into.
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)