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

database

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: BSD-3-Clause Imports: 20 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) (database *DB, err 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.

func (*DB) SQLDB

func (db *DB) SQLDB() (*sql.DB, error)

type MigrationOptions

type MigrationOptions struct {
	AllowDowngrade bool
}

Jump to

Keyboard shortcuts

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