d1

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDatabaseNotFound = errors.New("d1: database not found")
)

Functions

func OpenConnector

func OpenConnector(ctx context.Context, name string) (driver.Connector, error)

OpenConnector returns Connector of D1. This method checks DB existence. If DB was not found, this function returns error.

Types

type Conn

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

func (*Conn) Begin

func (c *Conn) Begin() (driver.Tx, error)

func (*Conn) BeginTx

func (c *Conn) BeginTx(context.Context, driver.TxOptions) (driver.Tx, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Prepare

func (c *Conn) Prepare(query string) (driver.Stmt, error)

func (*Conn) PrepareContext

func (c *Conn) PrepareContext(_ context.Context, query string) (driver.Stmt, error)

type Connector

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

func (*Connector) Connect

func (c *Connector) Connect(context.Context) (driver.Conn, error)

Connect returns Conn of D1. This method doesn't check DB existence, so this function never return errors.

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

type Driver

type Driver struct{}

func (*Driver) Open

func (d *Driver) Open(string) (driver.Conn, error)

Jump to

Keyboard shortcuts

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