Skip to content

Instantly share code, notes, and snippets.

@nurey
Created March 13, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurey/53f7b65c6f70a0ba759c32128e5a66fb to your computer and use it in GitHub Desktop.
Save nurey/53f7b65c6f70a0ba759c32128e5a66fb to your computer and use it in GitHub Desktop.
var source = rethinkdb({
// "uri": "${RETHINKDB_URI}"
"uri": "rethink://localhost:28015/foundation",
// "timeout": "30s",
"tail": true
// "ssl": false
// "cacerts": ["/path/to/cert.pem"]
})
var sink = postgres({
// "uri": "${POSTGRESQL_URI}"
"uri": "postgres://ilia@localhost:5432/client_app_development?sslmode=disable"
// "debug": false,
// "tail": false,
// "replication_slot": "slot"
})
t.Source("source", source, "sold_listings")
.Transform(pick({
"fields":
["id", "days-on-market", "mls", "price", "sold-date", "sold-price", "postal-code"]
}))
.Transform(rename({
"field_map": {
"id": "rethink_id",
"days-on-market": "days_on_market",
"sold-date": "sold_date",
"sold-price": "sold_price",
"postal-code": "postal_code"
}
}))
.Save("sink", sink, "sold_listings")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment