Documentation ¶
Index ¶
Constants ¶
View Source
const ( DriverSQLServer = "mssql" DriverMySQL = "mysql" )
Defines all possible sql drivers
Variables ¶
This section is empty.
Functions ¶
func InitConnection ¶
InitConnection - Inizializza la connessione impostando il driver e la stringa di connessione
func QueryOrPanic ¶
QueryOrPanic - Esegue fisicamente la query e restituisce l'istanza di *Rows, panic in caso di errore
func TableExists ¶
TableExists - Restituisce true se la tabella esiste altrimenti false
Types ¶
type SQLConnector ¶
type SQLConnector interface { DriverName() string Exec(string, ...interface{}) (sql.Result, error) Prepare(string) (*sql.Stmt, error) Preparex(string) (*sqlx.Stmt, error) Query(string, ...interface{}) (*sql.Rows, error) Queryx(string, ...interface{}) (*sqlx.Rows, error) QueryRow(string, ...interface{}) *sql.Row QueryRowx(string, ...interface{}) *sqlx.Row }
SQLConnector - Interfaccia per gestire operazioni sotto transaction
func GetConnection ¶
func GetConnection() SQLConnector
GetConnection - restituisce un'istanza di connessione al database
Click to show internal directories.
Click to hide internal directories.