my2pg

package
v0.0.0-...-75657e5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PgFormatter

func PgFormatter(buf *sqlparser.TrackedBuffer, node sqlparser.SQLNode)

Types

type PgSpecialFeatures

type PgSpecialFeatures struct {
	my2any.SpecialFeatures
}

func (PgSpecialFeatures) Perform

func (p PgSpecialFeatures) Perform(db my2any.GenericDB, cmd string, args ...string) (*sql.Rows, error)

func (PgSpecialFeatures) Rewrite

func (p PgSpecialFeatures) Rewrite(db my2any.GenericDB, ast sqlparser.Statement, pvp *int) (string, bool)

SELECT

a.attname::text AS "InsertID"
FROM pg_catalog.pg_attribute a

WHERE a.attrelid = (

SELECT cls.oid
FROM pg_catalog.pg_class cls
JOIN pg_catalog.pg_namespace nsp ON cls.relnamespace=nsp.oid
WHERE relname = 'aitest' AND nspname = 'public'

) AND a.attnum > 0 AND 'a' IN (SELECT 'a'::char FROM pg_catalog.pg_attrdef b WHERE (a.attrelid = b.adrelid AND a.attnum = b.adnum ) AND adsrc LIKE 'nextval%') AND 'p' IN (SELECT contype FROM pg_catalog.pg_constraint b WHERE (a.attrelid = b.conrelid AND array[a.attnum] <@ b.conkey ))

type PgSyntaxer

type PgSyntaxer struct {
	my2any.Syntaxer
}

func (PgSyntaxer) EncodeAny

func (PgSyntaxer) EncodeAny(ast sqlparser.Statement) string

func (PgSyntaxer) Preprocess

func (PgSyntaxer) Preprocess(ast sqlparser.Statement, schema string)

type PqConverter

type PqConverter struct {
	my2any.Converter
}

func (PqConverter) Convert

func (p PqConverter) Convert(nct *sql.ColumnType) (col *sqlv.Column, scan interface{})

Jump to

Keyboard shortcuts

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