sql

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sql wraps a database/sql driver so calls are subject to chaos. Register a chaos driver name that points at an existing registered driver, then sql.Open chaos name.

Example:

chaossql.Register("chaos:postgres", "postgres", eng)
db, _ := sql.Open("chaos:postgres", dsn)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(driverName, wrappedDriverName string, eng *engine.Engine)

Register registers a driver that wraps wrappedDriverName with chaos. The wrapped driver must already be registered with database/sql. Subsequent calls to sql.Open(driverName, dsn) get chaos-wrapped driver.

Panics if driverName is already registered (per database/sql semantics).

Types

This section is empty.

Jump to

Keyboard shortcuts

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