database

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: AGPL-3.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TicketsTable   = Table{ID: "tickets", Name: "Tickets"}
	CommentsTable  = Table{ID: "comments", Name: "Comments"}
	LinksTable     = Table{ID: "links", Name: "Links"}
	TasksTable     = Table{ID: "tasks", Name: "Tasks"}
	TimelinesTable = Table{ID: "timeline", Name: "Timeline"}
	FilesTable     = Table{ID: "files", Name: "Files"}
	TypesTable     = Table{ID: "types", Name: "Types"}
	UsersTable     = Table{ID: "users", Name: "Users"}
	GroupsTable    = Table{ID: "groups", Name: "Groups"}
	ReactionsTable = Table{ID: "reactions", Name: "Reactions"}
	WebhooksTable  = Table{ID: "webhooks", Name: "Webhooks"}

	DashboardCountsTable = Table{ID: "dashboard_counts", Name: "Dashboard Counts"}
	SidebarTable         = Table{ID: "sidebar", Name: "Sidebar"}
	UserPermissionTable  = Table{ID: "user_permissions", Name: "User Permissions"}
	UserGroupTable       = Table{ID: "user_groups", Name: "User Groups"}
	GroupUserTable       = Table{ID: "group_users", Name: "Group Users"}
	GroupPermissionTable = Table{ID: "group_permissions", Name: "Group Permissions"}
	GroupParentTable     = Table{ID: "group_parents", Name: "Group Parents"}
	GroupChildTable      = Table{ID: "group_children", Name: "Group Children"}

	CreateAction = "create"
	UpdateAction = "update"
	DeleteAction = "delete"
)

Functions

func DB

func DB(ctx context.Context, dir string) (*sqlc.Queries, func(), error)

func GenerateID

func GenerateID(prefix string) string

func Paginate

func Paginate(ctx context.Context, f func(ctx context.Context, offset, limit int64) (nextPage bool, err error)) error

func PaginateItems

func PaginateItems[T any](ctx context.Context, f func(ctx context.Context, offset, limit int64) (items []T, err error)) ([]T, error)

func TestDB

func TestDB(t *testing.T, dir string) *sqlc.Queries

Types

type Table

type Table struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

func Tables

func Tables() []Table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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