postgres

package
v0.0.0-...-a4cd505 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPgDollarTag

func GetPgDollarTag() string

GetPgDollarTag returns the current Postgres string dollar quoting tag.

Types

type Postgres

type Postgres struct{}

Postgres is the PostgeSQL dialect.

func New

func New() *Postgres

New returns a new Postgres dialect.

func (*Postgres) WriteFormattedTime

func (pd *Postgres) WriteFormattedTime(buf common.BufferWriter, t time.Time)

WriteFormattedTime formats t into a format postgres understands. Taken with gratitude from pq: https://github.com/lib/pq/blob/b269bd035a727d6c1081f76e7a239a1b00674c40/encode.go#L403

func (*Postgres) WriteIdentifier

func (pd *Postgres) WriteIdentifier(buf common.BufferWriter, ident string)

WriteIdentifier writes escaped identifier.

func (*Postgres) WriteStringLiteral

func (pd *Postgres) WriteStringLiteral(buf common.BufferWriter, val string)

WriteStringLiteral writes an escaped string. No escape characters are allowed.

Postgres 9.1+ does not allow any escape sequences by default. See http://www.postgresql.org/docs/9.3/interactive/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS-ESCAPE In short, all backslashes are treated literally not as escape sequences.

Jump to

Keyboard shortcuts

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