dialect

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	// EscapeIdent safely escapes identificatiors (such as column or table
	// names, etc.)
	EscapeIdent(w io.Writer, ident string)

	// EscapeBool safely escapes boolean variables.
	EscapeBool(w io.Writer, v bool)

	// EscapeString safely escapes strings.
	EscapeString(w io.Writer, s string)

	// EscapeBytes safely escapes byte slices.
	EscapeBytes(w io.Writer, b []byte)

	// EscapeTime safely escapes time.Time variables.
	EscapeTime(w io.Writer, t time.Time)

	// PrintPlaceholderSign prints nth placeholder sign starting from 1.
	PrintPlaceholderSign(w io.Writer, n int)
}

Dialect is the interface that describes a dialect of a particular SQL driver.

var MySQL Dialect = mySQL{}

MySQL is the implementation of Dialect for MySQL drivers.

Note that the EscapeTime method ignores the time zone, so if you want to work with time zones different from your MySQL connection time zone setting, you must convert it first.

Jump to

Keyboard shortcuts

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