db

package
v0.0.0-...-66d4bb3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Prepare

func Prepare(conn *pgx.Conn, schemas []string, includeTables, excludeTables []string) error

Prepare prepares the database for capturing changesets. This will setup:

  • new `warp_pipe` schema
  • new `changesets` table in the `warp_pipe` schema
  • new TRIGGER function to be fired AFTER an INSERT, UPDATE, or DELETE on a table
  • registers the trigger with all configured tables in the source schema

func Teardown

func Teardown(conn *pgx.Conn) error

Teardown removes the `warp_pipe` schema and all associated tables and functions.

Types

type Wal2JSONChange

type Wal2JSONChange struct {
	Kind         string           `json:"kind"`
	Schema       string           `json:"schema"`
	Table        string           `json:"table"`
	ColumnNames  []string         `json:"columnnames"`
	ColumnTypes  []string         `json:"columntypes"`
	ColumnValues []interface{}    `json:"columnvalues"`
	OldKeys      *Wal2JSONOldKeys `json:"oldkeys"`
}

Wal2JSONChange represents a changeset within a Wal2JSONMessage.

type Wal2JSONMessage

type Wal2JSONMessage struct {
	Changes []*Wal2JSONChange `json:"change"`
	NextLSN string            `json:"nextlsn"`
}

Wal2JSONMessage represents a wal2json message object.

type Wal2JSONOldKeys

type Wal2JSONOldKeys struct {
	KeyNames  []string      `json:"keynames"`
	KeyTypes  []string      `json:"keytypes"`
	KeyValues []interface{} `json:"keyvalues"`
}

Wal2JSONOldKeys represents the `oldkeys` object in a Wal2JSON change

Jump to

Keyboard shortcuts

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