Help us shape the future of Go! Take the 2026 Go Developer Survey

database

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetGormLogger

func SetGormLogger(l logger.Interface)

Types

type DB

type DB struct {
	*gorm.DB
}

func Initialize

func Initialize(ctx context.Context, databaseURL string, options MigrationOptions) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) FindEnvironmentIDByApiKey

func (db *DB) FindEnvironmentIDByApiKey(ctx context.Context, apiKey string) (string, error)

FindEnvironmentIDByApiKey finds the environment ID that is associated with the given API key. It queries the api_keys table to validate the key and find the associated environment.

type MigrationOptions added in v1.16.1

type MigrationOptions struct {
	AllowDowngrade bool
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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