postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefabCurrentDatabase = "SELECT current_database()"
	PrefabDatabases       = "SELECT datname FROM pg_database"
	PrefabTables          = "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"
	PrefabColumns         = "SELECT column_name FROM information_schema.columns WHERE table_name = $1"
	PrefabColumnsFormat   = "SELECT column_name FROM information_schema.columns WHERE table_name = '%s'"
	PrefabCountFormat     = "SELECT COUNT(*) FROM %s"
	PrefabCountDBFormat   = "SELECT COUNT(*) FROM %s.%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Postgres

type Postgres struct{}

func NewPostgresDriver

func NewPostgresDriver() (*Postgres, error)

func (*Postgres) Capabilities

func (p *Postgres) Capabilities() []database.Capabilities

Capabilities implements database.Dialect.

func (*Postgres) ConnectionStringTemplate

func (p *Postgres) ConnectionStringTemplate() *template.Template

func (*Postgres) Dialect

func (p *Postgres) Dialect() database.SQLDialect

func (*Postgres) GetPrefab

func (p *Postgres) GetPrefab(r database.Request) (string, []any, error)

func (*Postgres) GetTemplate

func (p *Postgres) GetTemplate(queryType database.RequestType) string

GetTemplate implements database.Dialect.

func (*Postgres) IncreamentPlaceholder

func (p *Postgres) IncreamentPlaceholder() string

IncreamentPlaceholder implements database.Dialect.

func (*Postgres) Name

func (p *Postgres) Name() string

Name implements database.SQLDialect.

func (*Postgres) Quote

func (p *Postgres) Quote(value string) string

Quote implements database.Dialect.

func (*Postgres) QuoteRune

func (p *Postgres) QuoteRune() rune

QuoteRune implements database.Dialect.

func (*Postgres) RenderCurrentTimestamp

func (p *Postgres) RenderCurrentTimestamp() string

RenderCurrentTimestamp implements database.Dialect.

func (*Postgres) RenderPlaceholder

func (p *Postgres) RenderPlaceholder(index int) string

RenderPlaceholder implements database.Dialect.

func (*Postgres) RenderTypeCast

func (p *Postgres) RenderTypeCast() string

RenderTypeCast implements database.Dialect.

func (*Postgres) RenderValue

func (p *Postgres) RenderValue(value any) string

RenderValue implements database.Dialect.

func (*Postgres) ResolveType

func (p *Postgres) ResolveType(dbType string, value []byte) (any, error)

Jump to

Keyboard shortcuts

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