database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package database provides database connection and management.

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB is the global database connection.

Functions

func Close

func Close() error

Close closes the database connection.

func Connect

func Connect(cfg Config) (*gorm.DB, error)

Connect establishes a connection to the database.

Types

type Config

type Config struct {
	URL         string
	MaxIdleConn int
	MaxOpenConn int
	Debug       bool
}

Config holds database configuration.

Directories

Path Synopsis
Package migrations contains one-shot, idempotent schema migrations invoked from the server's startup AutoMigrate flow.
Package migrations contains one-shot, idempotent schema migrations invoked from the server's startup AutoMigrate flow.
Package models contains the database model definitions.
Package models contains the database model definitions.
Package repositories provides data access layer implementations.
Package repositories provides data access layer implementations.

Jump to

Keyboard shortcuts

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