conn

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GORM_HOST     = os.Getenv("GORM_HOST")
	GORM_PORT     = os.Getenv("GORM_PORT")
	GORM_USERNAME = os.Getenv("GORM_USERNAME")
	GORM_PASSWORD = os.Getenv("GORM_PASSWORD")
	GORM_DATABASE = os.Getenv("GORM_DATABASE")
)

Functions

func MySQL

func MySQL(host, port, username, password, database string, silent ...bool) (*gorm.DB, error)

MySQL connects to a MySQL database and returns a gorm.DB object. By default, the silent parameter is false, which means that the gorm.DB object will log all SQL statements to the console.

func PostgreSQL

func PostgreSQL(host, port, username, password, database string, silent ...bool) (*gorm.DB, error)

PostgreSQL connects to a MySQL database and returns a gorm.DB object. By default, the silent parameter is false, which means that the gorm.DB object will log all SQL statements to the console.

func QuickMySQL

func QuickMySQL(silent ...bool) (*gorm.DB, error)

QuickMySQL connects to a MySQL database using the environment variables.

func QuickPostgreSQL

func QuickPostgreSQL(silent ...bool) (*gorm.DB, error)

QuickPostgreSQL connects to a MySQL database using the environment variables.

func Sqlite

func Sqlite(path string, silent ...bool) (*gorm.DB, error)

Sqlite connects to a SQLite database and returns a gorm.DB object. By default, the silent parameter is false, which means that the gorm.DB object will log all SQL statements to the console.

func SqliteMem

func SqliteMem(silent ...bool) (*gorm.DB, error)

SqliteMem connects to a SQLite database in memory and returns a gorm.DB object. By default, the silent parameter is false, which means that the gorm.DB object will log all SQL statements to the console.

Types

This section is empty.

Jump to

Keyboard shortcuts

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