Giter Club home page Giter Club logo

db-webhooks's Introduction

๐Ÿช DB Webhooks

Database Webhooks for Postgres

DB Webhooks is a utility for Postgres that triggers webhooks when rows are inserted, updated, or deleted. It uses database triggers that send low-latency websocket messages to a lightweight Go application. This application then calls the configured webhook(s) with a JSON payload that includes specified values from the database row.

DB Webhooks Flow

Use Cases

  • Send notifications: Slack, Email, Text Message, Push Notification
  • Call serverless functions: AWS Lambda, Google Cloud Functions, Azure Functions
  • Trigger analytics events: Segment, Mixpanel, Amplitude
  • Connect to automation platforms: Zapier, Trigger.dev, Pipedream

Steps

  1. Data added in Postgres table (INSERT)
  2. Postgres trigger notifies DB Webhooks web server via websocket message
  3. DB Webhooks formats data and sends webhook(s)

Get Started

Note: This install script only supports Linux distros that use yum and systemd and will install the application as a service. If you want to run the program as a native executable you can download and build the repo instead.

wget https://raw.githubusercontent.com/portola-labs/db-webhooks/main/install-linux.sh
chmod +x install-linux.sh
./install-linux.sh

The script will:

  • Download the repo and necessary dependencies
  • Prompt you to add your environment variables to the .env file
    • Note: Make sure the user you add has read permissions on the specified database
    • Note: This is also where you'll specific the POST request URL and body, which can contain templated variables which map to the column names whose values you want to include in the request
  • Build the executable and run it as a service
  • Create the trigger creation SQL which then has to be executed manually

Roadmap

Right now the alpha version only supports monitoring INSERTS from one table and firing one webhook. We'll be adding support for:

  • Triggers on any number of tables
  • Monitoring for different operations (INSERT, UPDATE, DELETE)
  • Filters and mapping options the row data to the POST request

Let us know your feedback or feature requests! You can submit and issue or contact us at [email protected]

db-webhooks's People

Contributors

ciminelli avatar mpatin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.