bun

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context) (db.DB, error)

New creates a new bun database client

Types

type Bun

type Bun struct {
	*bun.DB
	// contains filtered or unexported fields
}

Bun represents a bun db connection and it's error handler

func (*Bun) ProcessError

func (conn *Bun) ProcessError(err error) db.Error

ProcessError replaces any known values with our own db.Error types

type Client added in v0.0.4

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

Client is a DB interface compatible client for Bun

func (*Client) Close added in v0.0.4

func (c *Client) Close(ctx context.Context) db.Error

Close closes the bun db connection

func (*Client) Create added in v0.0.4

func (c *Client) Create(ctx context.Context, i any) db.Error

Create inserts an object into the database

func (*Client) DoMigration added in v0.0.4

func (c *Client) DoMigration(ctx context.Context) db.Error

DoMigration runs schema migrations on the database

func (*Client) LoadTestData added in v0.0.4

func (c *Client) LoadTestData(ctx context.Context) db.Error

func (*Client) ReadUserByEmail added in v0.0.4

func (u *Client) ReadUserByEmail(ctx context.Context, email string) (*models.User, db.Error)

func (*Client) ReadUserByID added in v0.0.4

func (u *Client) ReadUserByID(ctx context.Context, id string) (*models.User, db.Error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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