Skip to content

ejholmes/pgstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PGStream

PGStream is a Go package that implements the io.ReadWriter interface backed by posgres and database/sql.

This allows you to pass around an io.Reader or io.Writer that can be shared across processes.

Usage

First, create a table with the following schema:

CREATE TABLE logs (
  id SERIAL,
  stream text not null,
  text text
);

CREATE INDEX index_stream_on_logs ON logs USING btree (stream);

Then initialize a new pgstream engine:

rw := pgstream.New("mylogs", db)

io.WriteString(rw, "Log line")

io.Copy(os.Stdout, rw)

Releases

No releases published

Packages

No packages published