mysql

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mysql registers the MySQL/MariaDB driver and grammar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Grammar

type Grammar struct{}

Grammar implements database.Grammar for MySQL/MariaDB.

func (Grammar) CompileType

func (Grammar) CompileType(kind string, opts database.ColumnTypeOptions) string

CompileType renders a MySQL column type.

func (Grammar) LastInsertIDStrategy

func (Grammar) LastInsertIDStrategy() database.InsertIDStrategy

LastInsertIDStrategy returns FromResult.

func (Grammar) Name

func (Grammar) Name() string

Name returns the driver name.

func (Grammar) Placeholder

func (Grammar) Placeholder(_ int) string

Placeholder returns "?" — MySQL uses positional ? placeholders.

func (Grammar) Quote

func (Grammar) Quote(ident string) string

Quote wraps an identifier in backticks.

func (Grammar) SupportsReturning

func (Grammar) SupportsReturning() bool

SupportsReturning is false in MySQL (MariaDB 10.5+ does, but we use LastInsertId for portability).

Jump to

Keyboard shortcuts

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