dal

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpaceDB

func GetSpaceDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

GetSpaceDB returns the database instance for Space (only active records).

Types

type Space

type Space struct {
	DB *gorm.DB
}

Space data access layer

func (*Space) Create

func (a *Space) Create(ctx context.Context, item *schema.Space) error

Create a new space.

func (*Space) Delete

func (a *Space) Delete(ctx context.Context, id string) error

Delete the specified space logically (soft delete).

func (*Space) Exists

func (a *Space) Exists(ctx context.Context, id string) (bool, error)

Exists checks if the specified space exists in the database.

func (*Space) ExistsCode

func (a *Space) ExistsCode(ctx context.Context, code string) (bool, error)

ExistsCode checks if a space with the given code exists.

func (*Space) ExistsModels

func (a *Space) ExistsModels(ctx context.Context, spaceCode string) (bool, error)

ExistsModels checks if there are any active models associated with the space code.

func (*Space) Get

func (a *Space) Get(ctx context.Context, id string, opts ...schema.SpaceQueryOptions) (*schema.Space, error)

Get the specified space from the database.

func (*Space) Query

Query spaces from the database based on the provided parameters and options.

func (*Space) Update

func (a *Space) Update(ctx context.Context, item *schema.Space) error

Update the specified space in the database.

Jump to

Keyboard shortcuts

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