db

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrations

func RunMigrations(db *gorm.DB) error

RunMigrations is a helper function to run the migrations for the database.

Types

type Database

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

Database is a struct that represents the database adapter.

func New

func New(gorm *gorm.DB) *Database

New creates a new instance of the Database adapter.

func (*Database) Create

func (d *Database) Create(ctx context.Context, account *models.Account) error

Create is a method that creates a new account.

func (*Database) Delete

func (d *Database) Delete(ctx context.Context, account *models.Account) error

Delete is a method that deletes an account.

func (*Database) Get

func (d *Database) Get(ctx context.Context, account *models.Account) error

Get is a method that returns an account by ID.

func (*Database) GetCurrent

func (d *Database) GetCurrent(ctx context.Context, account *models.Account) error

GetCurrent is a method that returns the current account.

func (*Database) List

func (d *Database) List(ctx context.Context, accounts *[]models.Account) error

List is a method that returns a list of all accounts.

func (*Database) Update

func (d *Database) Update(ctx context.Context, account *models.Account) error

Update is a method that updates an account.

Jump to

Keyboard shortcuts

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