Documentation
¶
Index ¶
- type Connection
- func (c Connection) CreateObjects(table_name string, all_data ...map[string]string) (message string, ok bool)
- func (c Connection) DeleteObjects(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) Open()
- func (c Connection) QueryAll(sql string) ([]map[string]string, error)
- func (c Connection) QueryOne(sql string) (map[string]string, error)
- func (c Connection) QueryWithoutANSWER(sql, mje string) bool
- func (c Connection) ReadAllObjects(table_name string, limit uint8, names_to_order ...string) (out []map[string]string)
- func (c Connection) ReadObject(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, orm dbtools.OrmAdapter)
- func (c Connection) UpdateObjects(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 ¶
func (Connection) CreateObjects ¶
func (c Connection) CreateObjects(table_name string, all_data ...map[string]string) (message string, ok bool)
CreateObjects
func (Connection) DeleteObjects ¶
func (c Connection) DeleteObjects(table_name string, all_data ...map[string]string) (message string, ok bool)
DeleteObjects borra objetos de la base de datos según nombre de la tabla y ids.
func (Connection) Exists ¶
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) Open ¶
func (c *Connection) Open()
Conexión única (Open Stable) no cerrar al usar
func (Connection) QueryAll ¶
func (c Connection) QueryAll(sql string) ([]map[string]string, error)
QueryAll .
func (Connection) QueryOne ¶
func (c Connection) QueryOne(sql string) (map[string]string, error)
QueryOne . https://my.oschina.net/nowayout/blog/139398
func (Connection) QueryWithoutANSWER ¶
func (c Connection) QueryWithoutANSWER(sql, mje string) bool
QueryWithoutANSWER SinResultado ejecuta sql en bd con sin respuesta de mas de 1 operación recibe sql y mensaje a mostrar en consola
func (Connection) ReadAllObjects ¶
func (c Connection) ReadAllObjects(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) ReadObject ¶
func (c Connection) ReadObject(table_name, id string) map[string]string
ReadObject
func (Connection) SelectValue ¶
func (c Connection) SelectValue(sql string) (out string, ok bool)
SelectValue retorna valor de una consulta sql
func (*Connection) Set ¶
func (c *Connection) Set(dba databaseAdapter)
setear conexión base de datos cerrar después de usar
func (*Connection) TestCrudStart ¶
func (c *Connection) TestCrudStart(t *testing.T, orm dbtools.OrmAdapter)
func (Connection) UpdateObjects ¶
func (c Connection) UpdateObjects(table_name string, all_data ...map[string]string) (message string, ok bool)
UpdateObjects