Giter Club home page Giter Club logo

inquery's Introduction

Inquery

Real-time events platform for Postgres

Twitter GitHub Repo stars

Inquery 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 Go application. This application then calls the configured webhook(s) with a JSON payload that includes specified values from the database row.

Inquery Flow

How It Works

  1. Data is modified in Postgres table (INSERT, UPDATE, DELETE)
  2. Postgres trigger notifies the Inquery web server via a websocket message
  3. Inquery formats the data and sends the webhook(s)

Inquery Create Slack Notification

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
  • Stream data real-time: Snowflake, BigQuery, Clickhouse, Redshift

Get Started

Run Inquery locally

You can run Inquery locally with Docker.

git clone --depth 1 https://github.com/inqueryio/inquery.git
cd inquery
docker-compose up -d

Then open http://localhost:3000 to access Inquery.

Note: When connecting your database, if your Postgres host is localhost, you must use host.docker.internal instead to access it when running with Docker.

Run Inquery on AWS (EC2)

Note: Make sure this instance is only accessible within your VPC.
Note: These instructions are for Amazon Linux 2 AMI (HVM).

  1. To install Docker, run the following command in your SSH session on the instance terminal:
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker $USER
logout # Needed to close the SSH session so Docker does not have to be run as root
  1. To install docker-compose, run the following command in your ssh session on the instance terminal:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-$(uname -s)-$(uname -m)"  -o /usr/local/bin/docker-compose
sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
docker-compose version
  1. Install and run Inquery
mkdir inquery && cd inquery
wget https://raw.githubusercontent.com/inqueryio/inquery/main/{.env,docker-compose.yml,.dockerignore,frontend.env}
docker-compose up -d

Features

Template Strings

When adding an action, you can insert data from the row into the response body of the POST request by using template strings.
For instance, if your table has a column called email, you would put the value ${email} in the request body: {"text":"User created: ${email}!"}

The prefixes new. and old. can be used if a new (INSERT, UPDATE) or old (UPDATE, DELETE) row is available. If a prefix is not specified, the new or old values will be used depending on the event. Example: {"text":"User updated: ${old.email} is now ${new.email}!"}

The meta values meta.table (table name), meta.schema (schema name), meta.event (INSERT, UPDATE, or DELETE) can also be used.

Roadmap

  • Filters and mapping options for row data when sending a POST request

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

inquery's People

Contributors

ciminelli avatar handotdev 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.