Skip to content

Latest commit

 

History

History
44 lines (38 loc) · 1.13 KB

readme.md

File metadata and controls

44 lines (38 loc) · 1.13 KB

Elwood Database Control

Get more information at elwood.software.

This is a PostgreSQL TLE (extension) which attempts to provide supabase projects.

Docs available at elwood.software/docs/db.

Install or Update

/*
Requires:
  - pg_tle: https://github.com/aws/pg_tle
  - pgsql-http: https://github.com/pramsey/pgsql-http
*/
create extension if not exists http with schema extensions;
create extension if not exists pg_tle;
create extension if not exists vector schema extensions;
drop extension if exists "elwood-supabase";
select pgtle.uninstall_extension_if_exists('elwood-supabase');
select
    pgtle.install_extension(
        'elwood-supabase',
        resp.contents ->> 'version',
        'Elwood Supabase Database',
        resp.contents ->> 'sql'
    )
from http(
    (
        'GET',
        'https://elwood.software/db/latest.json',
        array[]::http_header[],
        null,
        null
    )
) x,
lateral (
    select
        ((row_to_json(x) -> 'content') #>> '{}')::json
) resp(contents);

create extension "elwood-supabase";