database

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate added in v0.2.0

func AutoMigrate(service session.Service) error

AutoMigrate runs the GORM auto-migration tool to ensure the database schema matches the internal storage models (e.g., storageSession, storageEvent).

NOTE: This function relies on a type assertion to the concrete *databaseService implementation. It will return an error if the provided session.Service is a different implementation.

func NewSessionService

func NewSessionService(dialector gorm.Dialector, opts ...gorm.Option) (session.Service, error)

NewSessionService creates a new session.Service implementation that uses a relational database (e.g., PostgreSQL, Spanner, SQLite) via the GORM library.

It requires a gorm.Dialector to specify the database connection and accepts optional gorm.Option values for further GORM configuration.

It returns the new session.Service or an error if the database connection gorm.Open fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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