iotdbsql

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package iotdbsql provides a deliberately small database/sql bridge over a shared official IoTDB client pool.

Index

Constants

This section is empty.

Variables

View Source
var ErrPreparedStatementsUnsupported = errors.New("iotdb: prepared statements are not supported by this adapter")

ErrPreparedStatementsUnsupported reports prepared-statement usage.

View Source
var ErrTransactionsUnsupported = errors.New("iotdb: transactions are not supported; configure GORM SkipDefaultTransaction=true")

ErrTransactionsUnsupported reports relational transaction usage against IoTDB.

Functions

func WithFullPathColumns added in v0.1.1

func WithFullPathColumns(ctx context.Context) context.Context

WithFullPathColumns marks a wildcard query so result columns retain complete server paths.

Types

type Binder

type Binder struct {
	TimePrecision TimePrecision
}

Binder safely renders value literals because the official client exposes SQL strings.

func (Binder) Bind

func (b Binder) Bind(query string, args []driver.NamedValue) (string, error)

Bind replaces positional placeholders outside quoted strings and comments.

type Connector

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

Connector creates lightweight database/sql connections sharing one backend pool.

func NewConnector

func NewConnector(runtime backend.Backend, binder Binder) *Connector

NewConnector creates a bridge connector around an already-owned backend.

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (driver.Conn, error)

Connect returns a logical connection; it never allocates another IoTDB pool.

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

Driver returns the connector's non-DSN driver facade.

type TimePrecision

type TimePrecision uint8

TimePrecision controls conversion of time.Time bind values to IoTDB integers.

const (
	// Milliseconds is IoTDB's common default timestamp precision.
	Milliseconds TimePrecision = iota
	// Microseconds converts timestamps to Unix microseconds.
	Microseconds
	// Nanoseconds converts timestamps to Unix nanoseconds.
	Nanoseconds
)

Jump to

Keyboard shortcuts

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