go_storage

package module
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 12 Imported by: 3 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go_storage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection added in v1.0.1

type Connection struct {
	*sql.DB
	// contains filtered or unexported fields
}

func Get added in v1.0.2

func Get(dba databaseAdapter) *Connection

obtener conexión

func (Connection) CreateElements added in v1.0.1

func (c Connection) CreateElements(table_name string, all_data ...map[string]string) (message string, ok bool)

CreateElements

func (Connection) DeleteElements added in v1.0.1

func (c Connection) DeleteElements(table_name string, all_data ...map[string]string) (message string, ok bool)

DeleteElements borra objetos de la base de datos según nombre de la tabla y ids.

func (Connection) Exists added in v1.0.1

func (c Connection) Exists(textResponse, objectSelect, sql string) (ok bool)

Exists verifica si existe un que es y algo en la base de datos según sql ej: "la base de datos","tiendadb","sql para la consulta"

func (Connection) GetConcatenateTITLES added in v1.0.1

func (c Connection) GetConcatenateTITLES(idname string, titles []string) (lst []map[string]string)

GetConcatenateTITLES retorna name y value concatenado un objeto por idname en caso de tablas foráneas titles ej: ["nombre","apellido"] campos que se mostraran al usuario en un listado

func (*Connection) MakeSQLSELECT added in v1.0.1

func (c *Connection) MakeSQLSELECT(option, TNAME string, obj map[string]string) (out string)

MakeSQLSELECT s(count(*),) tabla(jugador,usuario) id(2,7,12) genera un string sql según tabla y un maps clave valor

func (*Connection) Open added in v1.0.1

func (c *Connection) Open()

Conexión única (Open Stable) no cerrar al usar

func (Connection) QueryAll added in v1.0.1

func (c Connection) QueryAll(sql string) (rowsMap []map[string]string, ok bool)

QueryAll .

func (Connection) QueryOne added in v1.0.1

func (c Connection) QueryOne(sql string) (rowMap map[string]string, ok bool)

QueryOne . https://my.oschina.net/nowayout/blog/139398

func (Connection) QueryWithoutANSWER added in v1.0.1

func (c Connection) QueryWithoutANSWER(sql, mje string) bool

QueryWithoutANSWER SinResultado ejecuta sql en bd con sin respuesta de mas de 1 operacion un error recibe sql y mensaje a mostrar en consola

func (Connection) ReadAllElements added in v1.0.1

func (c Connection) ReadAllElements(table_name string, limit uint8, names_to_order ...string) (out []map[string]string)

table name ej: users,products limit ej 10, 5, 100. 0 no limit etc. note: postgres y mysql: "LIMIT 10", sqlite: "LIMIT 10 OFFSET 0" OR "" no limit names_to order ej: name,phone,address

func (Connection) ReadOneElement added in v1.0.1

func (c Connection) ReadOneElement(table_name, id string) map[string]string

ReadOneElement

func (Connection) SelectValue added in v1.0.1

func (c Connection) SelectValue(sql string) (out string, ok bool)

SelectValue retorna valor de una consulta sql

func (*Connection) Set added in v1.0.2

func (c *Connection) Set(dba databaseAdapter)

setear conexión base de datos

func (*Connection) TestCrudStart added in v1.0.1

func (c *Connection) TestCrudStart(t *testing.T)

func (Connection) UpdateElements added in v1.0.1

func (c Connection) UpdateElements(table_name string, all_data ...map[string]string) (message string, ok bool)

UpdateElements

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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