database

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 5 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 the database adapter for the builder server.

func NewDatabase

func NewDatabase(conn *gorm.DB) *Database

NewDatabase creates a new Database instance.

func (*Database) CreateSite

func (db *Database) CreateSite(ctx context.Context, site *models.Site) error

CreateSite creates a new site with the given name.

func (*Database) DeleteSite

func (db *Database) DeleteSite(ctx context.Context, site *models.Site) error

DeleteSite deletes the site with the given name.

func (*Database) GetSiteById

func (db *Database) GetSiteById(ctx context.Context, site *models.Site) (models.Site, error)

GetSiteById returns the site with the given id.

func (*Database) GetSiteByName

func (db *Database) GetSiteByName(ctx context.Context, site *models.Site) (models.Site, error)

GetSiteByName returns the site with the given name.

func (*Database) UpdateSite

func (db *Database) UpdateSite(ctx context.Context, site *models.Site) error

UpdateSite updates the site with the given name.

Jump to

Keyboard shortcuts

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