db

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(url string) error

Creates the database.

func Drop

func Drop(url string) error

Creates the database.

func GenerateMigration

func GenerateMigration(name string) error

func RunMigrations

func RunMigrations(fs embed.FS, conn *sqlx.DB) error

func WithDriver

func WithDriver(name string) connectionOption

Types

type ConnFn

type ConnFn func() (*sqlx.DB, error)

ConnFn is the database connection builder function that will be used by the application based on the driver and connection string.

func ConnectionFn

func ConnectionFn(url string, opts ...connectionOption) ConnFn

ConnectionFn is the database connection builder function that will be used by the application based on the driver and connection string. It opens the connection only once and return the same connection on subsequent calls.

Jump to

Keyboard shortcuts

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