oceanbase

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package oceanbase adapts an OceanBase database (MySQL protocol) to the core interfaces. It reuses the mysql provider's Adapter and Introspector, and implements its own EXPLAIN parser (OceanBase's plan JSON differs from MySQL, and varies by version; the parser degrades to ScanUnknown on any surprise rather than panicking).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect struct{}

Dialect is the OceanBase dialect. OceanBase speaks the MySQL wire protocol and reuses its quoting/placeholder rules. Distributed plans make estimates harder to trust, so the gate relies on ob_query_timeout + max_read_size (a runtime scan-row hard cap independent of estimates) + tenant resource isolation.

func (Dialect) Capabilities

func (Dialect) Capabilities() dialect.Capabilities

func (Dialect) ExplainSQL

func (Dialect) ExplainSQL(q string) string

func (Dialect) Name

func (Dialect) Name() string

func (Dialect) Placeholder

func (Dialect) Placeholder(i int) string

func (Dialect) QuoteIdent

func (Dialect) QuoteIdent(name string) string

type Provider

type Provider struct {
	*mysql.Adapter
	// contains filtered or unexported fields
}

Provider adapts an OceanBase database to the core interfaces.

func New

func New(dsn string) (*Provider, error)

New opens an OceanBase database (MySQL-protocol DSN) and assembles adapters.

func NewWithTimeout

func NewWithTimeout(dsn string, timeout time.Duration) (*Provider, error)

NewWithTimeout opens OceanBase with a DB-native query timeout.

func (*Provider) Dialect

func (p *Provider) Dialect() dialect.Dialect

Dialect returns the OceanBase dialect.

func (*Provider) Explainer

func (p *Provider) Explainer() cost.Explainer

Explainer returns the EXPLAIN-based plan estimator.

func (*Provider) Introspector

func (p *Provider) Introspector() introspect.Introspector

Introspector returns the schema introspector (reuses mysql's).

Jump to

Keyboard shortcuts

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