my

package
v0.0.0-...-03fb9fe Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package my adapts database/sql and go-sql-driver to the adapter.Tx interface, translating PostgreSQL-flavoured SQL on the way through (§4.3).

Three translations happen here, all of them mechanical:

  • $N placeholders become ?, with the arguments permuted to match.
  • "double-quoted" identifiers become `backticked` ones.
  • Fixed-size byte arrays (UUIDs, commit digests) become []byte on the way in and are copied back on the way out.

The third exists because pgx maps Go's [16]byte to uuid natively and database/sql does not: uuid.UUID's own Value() renders the 36-character text form, which would silently write text into a BINARY(16) column. Converting here keeps that difference out of every call site.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool wraps a database/sql pool.

func Open

func Open(ctx context.Context, dsn string) (*Pool, error)

func (*Pool) Close

func (p *Pool) Close()

func (*Pool) DB

func (p *Pool) DB() *sql.DB

func (*Pool) Dialect

func (p *Pool) Dialect() adapter.Dialect

func (*Pool) Direct

func (p *Pool) Direct() adapter.Tx

func (*Pool) InTx

func (p *Pool) InTx(ctx context.Context, fn func(adapter.Tx) error) error

InTx runs fn in a transaction. REPEATABLE READ is MySQL's default and is what the design assumes for a consistent read of the resolution chain (§11.1).

Jump to

Keyboard shortcuts

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