hoppersql

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package hoppersql is hopper's PostgreSQL driver for database/sql, for applications that already use it with lib/pq or pgx's stdlib adapter.

db, err := sql.Open("pgx", url)
client, err := hopper.NewClient(hoppersql.New(db), cfg)

It shares its SQL with hopperpgx and passes the same conformance suite. What database/sql cannot do, it does without: there is no COPY path (bulk inserts use the single-statement path) and no LISTEN, so clients poll at Config.PollInterval and the driver reports it once. Use hopperpgx for lowest latency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.3.0

type Config struct {
	// Schema is the PostgreSQL namespace for all Hopper objects. Empty means "hopper".
	Schema string
}

Config tunes the PostgreSQL driver.

type Driver

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

Driver implements driver.Driver[*sql.Tx] on a *sql.DB.

func New

func New(db *sql.DB) *Driver

New returns a driver on db in the default "hopper" schema. The database handle is shared with the application; the driver does not close it.

func NewWithConfig added in v0.3.0

func NewWithConfig(db *sql.DB, cfg *Config) *Driver

NewWithConfig is New with driver settings.

func (*Driver) Capabilities

func (d *Driver) Capabilities() driver.Capabilities

Capabilities implements driver.Driver.

func (*Driver) DB

func (d *Driver) DB() *sql.DB

DB returns the underlying database handle.

func (*Driver) Executor

func (d *Driver) Executor() driver.Executor

Executor implements driver.Driver.

func (*Driver) Listener

func (d *Driver) Listener(context.Context) (driver.Listener, error)

Listener implements driver.Driver: database/sql has no LISTEN.

func (*Driver) Migrator

func (d *Driver) Migrator() driver.Migrator

Migrator implements driver.Driver.

func (*Driver) UnwrapTx

func (d *Driver) UnwrapTx(tx *sql.Tx) driver.Executor

UnwrapTx implements driver.Driver.

Jump to

Keyboard shortcuts

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