pg

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: ISC Imports: 8 Imported by: 0

Documentation

Overview

Package pg is meta.Metadata on top of pgx. Queries are not executed: columns and parameters come from Prepare (the statement description), the rest from pg_catalog by the same rules as pgjdbc's DatabaseMetaData, to match the Java plug-in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnString

func ConnString(jdbcURL, user, pwd string) (string, error)

ConnString builds the pgx connection string from <jdbc url user pwd> of settings.xml. Both a JDBC URL (as in the Java plug-in) and a plain postgres:// are accepted.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, connString string) (*DB, error)

func (*DB) Close

func (db *DB) Close() error

func (*DB) IdentifierQuote added in v1.1.2

func (db *DB) IdentifierQuote() string

IdentifierQuote: as getIdentifierQuoteString of pgjdbc.

func (*DB) ImportedKeys

func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)

func (*DB) PKColNames

func (db *DB) PKColNames(tableRef string) ([]string, error)

func (*DB) RawOfJava

func (db *DB) RawOfJava(javaType string) string

func (*DB) SQLColumns

func (db *DB) SQLColumns(jdbcSQL string) ([]meta.Column, error)

func (*DB) SQLParams

func (db *DB) SQLParams(jdbcSQL string, typeCount int) (*meta.Params, error)

func (*DB) Table

func (db *DB) Table(tableRef string) (*meta.Table, error)

func (*DB) Tables

func (db *DB) Tables(includeViews bool) ([]string, error)

Tables: as pgjdbc getTables with no schema: all schemas but the system ones, tables ('r', 'p') before views, then by schema and name.

Jump to

Keyboard shortcuts

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