Documentation
¶
Index ¶
- type Connection
- func (c Connection) CreateElements(table_name string, all_data ...map[string]string) (message string, ok bool)
- func (c Connection) DeleteElements(table_name string, all_data ...map[string]string) (message string, ok bool)
- func (c Connection) Exists(textResponse, objectSelect, sql string) (ok bool)
- func (c Connection) GetConcatenateTITLES(idname string, titles []string) (lst []map[string]string)
- func (c *Connection) MakeSQLSELECT(option, TNAME string, obj map[string]string) (out string)
- func (c *Connection) Open()
- func (c Connection) QueryAll(sql string) (rowsMap []map[string]string, ok bool)
- func (c Connection) QueryOne(sql string) (rowMap map[string]string, ok bool)
- func (c Connection) QueryWithoutANSWER(sql, mje string) bool
- func (c Connection) ReadAllElements(table_name string, limit uint8, names_to_order ...string) (out []map[string]string)
- func (c Connection) ReadOneElement(table_name, id string) map[string]string
- func (c Connection) SelectValue(sql string) (out string, ok bool)
- func (c *Connection) Set(dba databaseAdapter)
- func (c *Connection) TestCrudStart(t *testing.T)
- func (c Connection) UpdateElements(table_name string, all_data ...map[string]string) (message string, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶ added in v1.0.1
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
Source Files
¶
- crud-read-data.go
- crud-read_method.go
- crud_create.go
- crud_create_testing.go
- crud_delete.go
- crud_delete_testing.go
- crud_read_testing.go
- crud_update.go
- crud_update_testing.go
- exists.go
- filter-message.go
- model-test.go
- model.go
- new_connect.go
- sql_auto_make.go
- sql_auto_select.go
- unit_crud_testing.go
- unit_data_testing.go
- unit_model_testing.go