cockroachdb

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package cockroachdb implements the CockroachDB driver as a thin wrapper over the PostgreSQL driver. CockroachDB uses the PG wire protocol, so the PG driver handles all the actual work.

Index

Constants

View Source
const DefaultDatabase = "defaultdb"

DefaultDatabase is the default CockroachDB database.

View Source
const DefaultPort = 26257

DefaultPort is the standard CockroachDB port.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, opts Opts) (driver.Connection, error)

Connect opens a CockroachDB connection via the PG driver.

func ConnectURL

func ConnectURL(ctx context.Context, url string, readonly bool) (driver.Connection, error)

ConnectURL opens a CockroachDB connection from a URL via the PG driver.

Types

type Opts

type Opts struct {
	Host     string
	Port     int
	Database string
	Username string
	Password string
	Readonly bool
}

Opts holds CockroachDB connection options.

Jump to

Keyboard shortcuts

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