mysql

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mysql wraps mysql driver as an adapter for REL.

Usage:

// open mysql connection.
adapter, err := mysql.Open("root@(127.0.0.1:3306)/rel_test?charset=utf8&parseTime=True&loc=Local")
if err != nil {
	panic(err)
}
defer adapter.Close()

// initialize REL's repo.
repo := rel.New(adapter)

Index

Constants

This section is empty.

Variables

View Source
var (

	// Config for mysql adapter.
	Config = sql.Config{
		DropIndexOnTable: true,
		Placeholder:      "?",
		EscapeChar:       "`",
		IncrementFunc:    incrementFunc,
		ErrorFunc:        errorFunc,
		MapColumnFunc:    sql.MapColumn,
	}
)

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	*sql.Adapter
}

Adapter definition for mysql database.

func New

func New(database *db.DB) *Adapter

New mysql adapter using existing connection.

func Open

func Open(dsn string) (*Adapter, error)

Open mysql connection using dsn.

Jump to

Keyboard shortcuts

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