dialect

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: Apache-2.0, MIT Imports: 2 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 string

Dialect represents the SQL database dialect being used.

const (
	// SQLite is the SQLite dialect (default).
	SQLite Dialect = "sqlite"
	// Postgres is the PostgreSQL dialect.
	Postgres Dialect = "postgres"
)

func (Dialect) InsertIgnore

func (d Dialect) InsertIgnore(table, columns, placeholders string) string

InsertIgnore returns the appropriate INSERT IGNORE/ON CONFLICT DO NOTHING syntax.

func (Dialect) IsPostgres

func (d Dialect) IsPostgres() bool

IsPostgres returns true if the dialect is PostgreSQL.

func (Dialect) IsSQLite

func (d Dialect) IsSQLite() bool

IsSQLite returns true if the dialect is SQLite (or empty/default).

func (Dialect) Rebind

func (d Dialect) Rebind(query string) string

Rebind converts ? placeholders to the appropriate dialect format. For PostgreSQL, ? is converted to $1, $2, etc. For SQLite, the query is returned unchanged.

Jump to

Keyboard shortcuts

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