goalMySql

package module
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: MIT Imports: 6 Imported by: 0

README

goalMySql

Go MySql library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(allowNativePassword bool) (*sql.DB, error)

MySql database connection initializer

func Insert added in v0.1.8

func Insert(databaseHandler *sql.DB, table string, columns []string, inputParameters ...any) (int, error)

Insert into MySql table. On success update this method will return how many rows affected. Please put your parameter placeholders values in inputParameters to prevent SQL Injection.

func PingDatabase

func PingDatabase(databaseHandler *sql.DB) (bool, error)

Ping to mysql database

func Replace added in v0.1.13

func Replace(databaseHandler *sql.DB, table string, columns []string, inputParameters ...any) (int, error)

Replace into MySql table. On success update this method will return how many rows affected. Please put your parameter placeholders values in inputParameters to prevent SQL Injection.

func Select

func Select(databaseHandler *sql.DB, columns []string, table string,
	condition string, inputParameters ...any) ([]map[string]interface{}, error)

MySql select query for multiple rows of data. Please put your parameter placeholders in inputParameters to prevent SQL Injection.

func Update added in v0.1.2

func Update(databaseHandler *sql.DB, table string, columns []string,
	condition string, inputParameters ...any) (int, error)

Update MySql table. On success update this method will return how many rows updated. Please put your parameter placeholders values in inputParameters to prevent SQL Injection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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