• Stars
    star
    473
  • Rank 92,832 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

pqstream turns your postgres database into an event stream

pqstream

pqstream is a program that streams changes out of a postgres database with the intent of populating other systems and enabling stream processing of data sets.

ci status go report card coverage

installation

$ go get -u github.com/tmc/pqstream/cmd/{pqs,pqsd}

basic usage

create an example database:

$ createdb dbname
# echo "create table notes (id serial, created_at timestamp, note text)" | psql dbname

connect the agent:

$ pqsd -connect postgresql://user:pass@host/dbname

connect the cli:

$ pqs

at this point you will see streams of database operations rendered to stdout:

(in a psql shell):

dbname=# insert into notes values (default, default, 'here is a sample note');
INSERT 0 1
dbname=# insert into notes values (default, default, 'here is a sample note');
INSERT 0 1
dbname=# update notes set note = 'here is an updated note' where id=1;
UPDATE 1
dbname=# delete from notes where id = 1;
DELETE 1
dbname=#

our client should now show our operations:

$ pqs
{"schema":"public","table":"notes","op":"INSERT","id":"1","payload":{"created_at":null,"id":1,"note":"here is a sample note"}}
{"schema":"public","table":"notes","op":"INSERT","id":"2","payload":{"created_at":null,"id":2,"note":"here is a sample note"}}
{"schema":"public","table":"notes","op":"UPDATE","id":"1","payload":{"created_at":null,"id":1,"note":"here is an updated note"},"changes":{"note":"here is a sample note"}}
{"schema":"public","table":"notes","op":"DELETE","id":"1","payload":{"created_at":null,"id":1,"note":"here is an updated note"}}

field redaction

If there's a need to prevent sensitive fields (i.e. PII) from being exported the redactions flag can be used with pqsd:

$ pqsd -connect postgresql://user:pass@host/dbname -redactions='{"public":{"users":["first_name","last_name","email"]}}'

The redactions is encoded in JSON and conforms to the following layout:

'{"schema":{"table":["field1","field2"]}}'`

More Repositories

1

langchaingo

LangChain for Go, the easiest way to write LLM-based programs in Go
Go
4,460
star
2

grpc-websocket-proxy

A proxy to transparently upgrade grpc-gateway streaming endpoints to use websockets
Go
532
star
3

gevent-zeromq

pyzeromq gevent compat. lib
Python
284
star
4

keyring

keyring provides a cross-platform keychain/keyring interface
Go
116
star
5

reactssr

reactssr is a package for rendering React applications.
Go
101
star
6

speechtotext

streaming stdin to speech recognition tool via Google Cloud Speech API
Go
88
star
7

watcher

watcher is a simple filesystem event watcher
Go
71
star
8

ssaview

ssaview live-renders the SSA representation of a go program
HTML
69
star
9

righthand

RightHand - A GPT4 powered assistive tool.
Go
61
star
10

scp

A basic implementation of scp for go.
Go
58
star
11

graphql

graphql parser + utilities
Go
57
star
12

dockerfiles

my dockerfiles
Shell
51
star
13

grpcutil

assortment of utilities related to building and running grpc services
Go
49
star
14

rules_helm

rules_helm: Bazel rules for managing helm charts
Python
46
star
15

smol-dev-go

smol-dev-go, a Go implementation of smol developer
Go
32
star
16

inj

Package inj provides a simple mechanism of dependency injection
Go
29
star
17

gevent-utils

miscellaneous gevent utilities
Python
22
star
18

goloz

goloz is a free and open source online multiplayer game.
Go
22
star
19

tmpl

tmpl - unix-friendly templating tool.
Go
22
star
20

parse_graphql

GraphQL server for your Parse Application
Go
17
star
21

eio

asynchronous file i/o for python via libeio
C
16
star
22

dot

graphviz dot language support for Go
Go
16
star
23

protoc-gen-apidocs

Generate beautiful documentation from your Protobuf descriptors.
Go
15
star
24

ent2d2

ent2d2 creates D2 graphs from ent schemas
Go
13
star
25

sc

Statecharts
Go
12
star
26

log

Package log wraps logrus to include source line/function information
Go
11
star
27

srcutils

tools to modify go programs
Go
11
star
28

mongologtools

Go
11
star
29

mutter

Runs arbitrary commands upon detection of file modifications
Python
11
star
30

k8s-terraform-aws-ubuntu

terraform provisioning of Kubernetes on AWS
Shell
10
star
31

goteal

Go to TEAL compiler
Go
9
star
32

django-smart-serializers

deprecated -- see django r11863
Python
9
star
33

clocks

clocks is a small utility to render additional time zones in your MacOS status bar.
Go
9
star
34

pystreamwatcher

raw example of using xmpp in the browser for real-time updates (using BOSH)
JavaScript
9
star
35

cgpt

cgpt - cli for OpenAI chat completions
Go
8
star
36

mongoproto

mongoproto implements the mongodb wire protocol
Go
8
star
37

statecharts

A set of components to describe a visual formalism.
7
star
38

sdgui

sdgui
TypeScript
6
star
39

django-mailfriend

Generic "mail this to a friend" app for Django
Python
6
star
40

glue

Small HTTP library for Go. Less than 250 LOC
Go
6
star
41

dbgp

dbgp debugger engine package for go
Go
6
star
42

grpc-uber

Objective-C
6
star
43

it2open

it2open opens iTerm2 panes and runs the commands provided on stdin.
Go
5
star
44

git-branchdescriptions

Python
5
star
45

django-imagekit

clone of http://bitbucket.org/jdriscoll/django-imagekit
Python
5
star
46

rules_homebrew

rules_homebrew provides Starlark to manage brew packages.
Python
4
star
47

fonts

Package fonts provides a cross-platform way to load font data for Go
Go
4
star
48

mootools-comet

JavaScript
4
star
49

adt

Package adt provides read access to ADT (Advantage) database files
Go
4
star
50

audioutil

audioutil
Go
4
star
51

fix

fix is an experimental conversion of the go fix tool to a library aimed to enable third party go library authors to easily write go fix style programs
Go
4
star
52

moderncrud

Go
3
star
53

pomodoro

simple pomodoro cli
Go
3
star
54

stunnel

out of date git clone of stunnel
Shell
3
star
55

rules_helm_example

example usage of rules_helm
Python
3
star
56

k6-to-honeycomb

Go
3
star
57

findbadseqs

script to repair postgres sequences in a django database, written for personal use but figured i'd share
Python
3
star
58

rest

Small resource-oriented http library
Go
3
star
59

mongocaputils

utilities for handling mongo pcap files
Go
3
star
60

protoc-gen-d2

protoc-gen-d2
Go
3
star
61

openfec

OpenFEC client library for Go
Go
3
star
62

690

Go
3
star
63

gevent-spawn

a gevent based http daemon for serving wsgi apps
Python
3
star
64

go

go
Makefile
3
star
65

the-gathering

TypeScript
3
star
66

the-AIvengers

Python
2
star
67

dlp

DLP (data loss prevention) tools.
Go
2
star
68

teal-examples

2
star
69

mips

Go
2
star
70

gitx

A gitk clone for OS X
Objective-C
2
star
71

notion-prev

https://github.com/tmc/notion
Go
2
star
72

pulid

Go
2
star
73

goit

libgit2 bindings for go
Go
2
star
74

epan

cgo bindings for libwireshark's epan library
Go
2
star
75

django-cumulus

A django utility that interfaces with the Mosso Cloud Files API.
Python
2
star
76

hn

Go
2
star
77

hackathon-starter

hackathon-starter
TypeScript
2
star
78

genkey

genkey generates rsa private keys
Go
2
star
79

slackutil

Go
2
star
80

utils

Go
2
star
81

mkprog

mkprog is a program to create programs
Go
2
star
82

gcan

gcan is a go implementation of a distributed commit log inspired by kafka
Go
1
star
83

maistro

mAIstro
Python
1
star
84

go-xsd

Go
1
star
85

figma

A figma client for Go.
Go
1
star
86

address-enrich

Go
1
star
87

d2labs

TypeScript
1
star
88

googlelog

googlelog sends stdin to Google Cloud Logging
Go
1
star
89

graphql-web-client

GraphQL web client
JavaScript
1
star
90

gitstats

gitstats provides intelligence about your git repositories
Go
1
star
91

tmc

Makefile
1
star
92

twilio

Go
1
star
93

makep

Go
1
star
94

grpc-intro

Go
1
star
95

climate-hack

climate-hack
Vue
1
star
96

fakedb

Go
1
star
97

bibtex

bibtex for go
Go
1
star
98

prism

prism is a tool for replaying http traffic
Go
1
star
99

srvgql

Go
1
star
100

wiretap

cgo bindings to libwiretap
Go
1
star