package
0.0.0-20230615175516-8d1887276f42
Repository: https://github.com/yggbrazil/go-toolbox.git
Documentation: pkg.go.dev

# README

database

É um wrapper do SQLx com o objetivo de entrar uma conexão com banco de dados (MySQL, Postgres ou SQLite) somente lhe indicando o arquivo env com os paramentros de conexão

** MAX_OPEN_CONNS ** Use este parametro no env para alterar o máximo de conexoes simultaneas possíveis

Exemplo

package main

import (
	"github.com/yggbrazil/go-toolbox/database"
)

func main() {
	db, err := database.GetByFile("sqlite3-config.json")

	if err != nil {
		panic(err)
	}

	var users map[string]string

	err = db.Select(&users, `select * from users`)

	if err != nil {
		panic(err)
	}
}

# Packages

No description provided by the author
No description provided by the author

# Functions

ConnectByConfig Create ou get a database connection through a configuration.
GetByFile Create a database connection through the path of a file.
MustGetByFile Create a database connection through the path of a file and generates a panic in case of error.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author