postgres

package
v2.11.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package postgres provides the PostgreSQL driver for the SQL executor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDriver

type PostgresDriver struct{}

PostgresDriver implements the Driver interface for PostgreSQL.

func (*PostgresDriver) AcquireAdvisoryLock

func (d *PostgresDriver) AcquireAdvisoryLock(ctx context.Context, db *sql.DB, lockName string) (func() error, error)

AcquireAdvisoryLock acquires a named advisory lock in PostgreSQL.

func (*PostgresDriver) BuildInsertQuery

func (d *PostgresDriver) BuildInsertQuery(table string, columns []string, rowCount int, onConflict, conflictTarget string, updateColumns []string) string

BuildInsertQuery generates a multi-row INSERT statement for PostgreSQL. If onConflict is "replace" and conflictTarget is provided, generates a proper UPSERT.

func (*PostgresDriver) Connect

func (d *PostgresDriver) Connect(ctx context.Context, cfg *sqlexec.Config) (*sql.DB, func() error, error)

Connect establishes a connection to PostgreSQL.

func (*PostgresDriver) ConvertNamedParams

func (d *PostgresDriver) ConvertNamedParams(query string, params map[string]any) (string, []any, error)

ConvertNamedParams converts named parameters to PostgreSQL positional format.

func (*PostgresDriver) Name

func (d *PostgresDriver) Name() string

Name returns the driver name.

func (*PostgresDriver) PlaceholderFormat

func (d *PostgresDriver) PlaceholderFormat() string

PlaceholderFormat returns the PostgreSQL placeholder format.

func (*PostgresDriver) QuoteIdentifier

func (d *PostgresDriver) QuoteIdentifier(name string) string

QuoteIdentifier quotes a table or column name for PostgreSQL. This handles reserved words and special characters by wrapping in double quotes.

func (*PostgresDriver) SupportsAdvisoryLock

func (d *PostgresDriver) SupportsAdvisoryLock() bool

SupportsAdvisoryLock returns true as PostgreSQL supports advisory locks.

Jump to

Keyboard shortcuts

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