Documentation ¶
Index ¶
- func CreateTable(db *sqlx.DB, tableName string, params map[string]string) error
- func InsertIntoTable(db *sqlx.DB, tableName string, id, typ string, config []byte) error
- func OpenDatabase(dataSourceName, dbDriver string) (*sqlx.DB, error)
- func QueryDatabase(db *sqlx.DB, tableName string, condition string) (*sqlx.Rows, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTable ¶
CreateTable creates a new table defined by a given name and specified column fields. CreateTable returns an error if a table could not be correctly created or when an SQL injection attacks was detected.
func InsertIntoTable ¶
InsertIntoTable allows to insert a new record into the specified table. The table name is checked for SQL injection attacks. The given input values are not explicitly checked, since the Exec build-in function should do this. The function returns an error if an SQL injection attack is detected or when insertion fails.
func OpenDatabase ¶
OpenDatabase opens a connection with a specified database. OpenDatabase returns the database object and an error.
func QueryDatabase ¶
QueryDatabase allows to query for records from a specified table, which Typ column satisfies a given condition. QueryDatabase checks for SQL injection in the tableName argument or condition argument. QueryDatabase returns a set of rows and an error.
Types ¶
This section is empty.