database

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: BSD-3-Clause Imports: 19 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.

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