0.0
No release in over 3 years
Low commit activity in last 3 years
Creates config files from ENV; Read/writes state from postgres database
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.21
~> 12
~> 4.49
 Project Readme

singer-heroku

A collection of utilities to facilitate running singer.io taps and targets on Heroku

Installation

gem install singer-heroku

Create this table in DATABASE_URL database

CREATE TABLE singer_states
  (
    key text NOT NULL,
    data jsonb,
    CONSTRAINT singer_states_pkey PRIMARY KEY (key)
  )

generate-config

Reads from #{KEY}_CONFIG_* environment variables and generates json to stdout.

Given the following ENV:

TEST_CONFIG_first_name=joe
TEST_CONFIG_last_name=lind

generate-config -k TEST
{"first_name":"joe","last_name":"lind"}

read-state

Reads JSON data from singer_states table in DATABASE_URL where key is #{KEY}, passed in args.

> read-state -kTEST
{"high_water_mark":4}

write-state

Reads jsonl from stdin and writes to database specified in DATABASE_URL

> cat states.json
{ "high_water_mark": 1 }
{ "high_water_mark": 2 }
{ "high_water_mark": 3 }
{ "high_water_mark": 4 }

> cat states.json | write-state -kTEST
> read-state -kTEST
{"high_water_mark":4}