bun

package
v0.0.0-...-0f594a8 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a DB interface compatible client for Bun.

func New

func New(ctx context.Context) (*Client, error)

New creates a new bun database client.

func (*Client) Close

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

Close closes the bun db connection.

func (*Client) CountInstances

func (c *Client) CountInstances(ctx context.Context) (int64, db.Error)

func (*Client) CountTags

func (c *Client) CountTags(ctx context.Context) (int64, db.Error)

func (*Client) CreateAccount

func (c *Client) CreateAccount(ctx context.Context, account *models.Account) db.Error

func (*Client) CreateInstance

func (c *Client) CreateInstance(ctx context.Context, instance *models.Instance) db.Error

func (*Client) CreateTag

func (c *Client) CreateTag(ctx context.Context, tag *models.Tag) db.Error

func (*Client) DoMigration

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

DoMigration runs schema migrations on the database.

func (*Client) IncAccountLoginCount

func (c *Client) IncAccountLoginCount(ctx context.Context, account *models.Account) db.Error

func (*Client) ReadAccount

func (c *Client) ReadAccount(ctx context.Context, id int64) (*models.Account, db.Error)

func (*Client) ReadAccountByUsername

func (c *Client) ReadAccountByUsername(ctx context.Context, username string, instanceID int64) (*models.Account, db.Error)

func (*Client) ReadInstance

func (c *Client) ReadInstance(ctx context.Context, id int64) (*models.Instance, db.Error)

func (*Client) ReadInstanceByDomain

func (c *Client) ReadInstanceByDomain(ctx context.Context, domain string) (*models.Instance, db.Error)

func (*Client) ReadInstancesPage

func (c *Client) ReadInstancesPage(ctx context.Context, index, count int) ([]*models.Instance, db.Error)

func (*Client) ReadTag

func (c *Client) ReadTag(ctx context.Context, id int64) (*models.Tag, db.Error)

func (*Client) ReadTagByName

func (c *Client) ReadTagByName(ctx context.Context, name string) (*models.Tag, db.Error)

func (*Client) ReadTagsPage

func (c *Client) ReadTagsPage(ctx context.Context, index, count int) ([]*models.Tag, db.Error)

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(ctx context.Context, account *models.Account) db.Error

func (*Client) UpdateInstance

func (c *Client) UpdateInstance(ctx context.Context, instance *models.Instance) db.Error

func (*Client) UpdateTag

func (c *Client) UpdateTag(ctx context.Context, tags *models.Tag) db.Error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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