8000 GitHub - tavallaie/orb_fdw: A foreign data wrapper for orb
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tavallaie/orb_fdw

 
 

Repository files navigation

Orb_fdw

This is a simple open-source data wrapper that bridges the gap between your Postgres database and Orb a leading usage-based billing solution.

Tembo Cloud Try Free

Static Badge PGXN version

Pre-requisistes

  • have the v0.13.0 of orb_fdw extension enabled in your instance

Create the foreign data wrapper:

create foreign data wrapper orb_wrapper
  handler orb_fdw_handler
  validator orb_fdw_validator;

Connect to orb using your credentials:

create server my_orb_server
  foreign data wrapper orb_wrapper
  options (
    api_key '<orb secret Key>')

Create Foreign Table:

Customers table

This table will store information about the users.

create foreign table orb_customers (
  user_id text,
  organization_id text,
  first_name text,
  email text,
  stripe_id text,
  created_at timestamp,
  attrs jsonb
  )
  server my_orb_server
  options (
      object 'customers'
  );

Subscriptions Table

This table will store information about the subscriptions.

create foreign table orb_subscriptions (
    subscription_id text,
    organization_id text,
    status text,
    plan text,
    started_date timestamp,
    end_date timestamp,
    attrs jsonb
  )
  server my_orb_server
  options (
    object 'subscriptions'
  );

Invoices Table

This table will store information about the subscriptions.

create foreign table orb_invoices (
    customer_id text,
    subscription_id text,
    organization_id text,
    status text,
    due_date timestamp,
    amount text,
    attrs jsonb
  )
  server my_orb_server
  options (
    object 'invoices'
  );

About

A foreign data wrapper for orb

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 95.9%
  • Makefile 4.1%
0