postgres

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	FieldOrdinal int
	Name         string
	DataType     string
	NotNull      bool
	Comment      *string
	DefaultValue *string
	IsPrimaryKey bool
}

Column struct

type DB

type DB struct {
	*pgx.Conn
}

DB is a connection

func Open

func Open(uri string) (*DB, error)

Open a URL

func (*DB) Generate

func (d *DB) Generate(imp *importer.Importer, schemas []string) (vfs.FileSystem, error)

Generate the database binding

func (*DB) Introspect

func (d *DB) Introspect(schemaName string) (*schema.Schema, error)

Introspect a postgres database

type ForeignKey

type ForeignKey struct {
	Name          string
	FullName      string
	DataType      string
	RefIndexName  string
	RefTableName  string
	RefColumnName string
	KeyID         int
	SeqNo         int
	OnUpdate      string
	OnDelete      string
	Match         string
}

ForeignKey struct

type Index

type Index struct {
	Name      string
	IsUnique  bool
	IsPrimary bool
	SeqNo     int
	Origin    string
	IsPartial bool
}

Index struct

type IndexColumn

type IndexColumn struct {
	SeqNo    int
	Cid      int
	Name     string
	DataType string
	NotNull  bool
}

IndexColumn struct

type Table

type Table struct {
	Type     byte   // type
	ManualPk bool   // manual_pk
	Name     string // table_name
}

Table struct

Jump to

Keyboard shortcuts

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