database

package
v0.0.0-...-35d39f0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(databaseURL string) (*bun.DB, error)

Connect creates a database connection based on the provided DATABASE_URL

func GetDatabaseType

func GetDatabaseType(databaseURL string) (string, error)

GetDatabaseType returns the database type from a DATABASE_URL

Types

type Config

type Config struct {
	Type     string
	Host     string
	Port     string
	Database string
	Username string
	Password string
	SSLMode  string
	Path     string // For SQLite
}

Config holds database connection configuration

func ParseDatabaseURL

func ParseDatabaseURL(databaseURL string) (*Config, error)

ParseDatabaseURL parses a DATABASE_URL and returns a DatabaseConfig

Jump to

Keyboard shortcuts

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