msql

package
v0.0.0-...-c20f884 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package msql implements connecting to a MySQL/MariaDB instance (and possibly others) and simplifies a number of interactions with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SQL

type SQL struct {
	*sqlx.DB
	// contains filtered or unexported fields
}

SQL is a wrapper around a sqlx client which provides more functionality.

func InstMySQL

func InstMySQL(cmp *mcmp.Component, defaultDB string) *SQL

InstMySQL returns a SQL instance which will be initialized when the Init event is triggered on the given Component. The SQL instance will have Close called on it when the Shutdown event is triggered on the given Component.

defaultDB indicates the name of the database in MySQL to use by default, though it will be overwritable in the config.

func (*SQL) Context

func (sql *SQL) Context() context.Context

Context returns the annotated Context from this instance's initialization.

Jump to

Keyboard shortcuts

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