mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
Merge pull request #16854 from supabase/or/dbdev-template
Add template for dbdev installer
This commit is contained in:
1 file changed
+42
@@ -1230,6 +1230,48 @@ begin
|
||||
limit match_count;
|
||||
end;
|
||||
$$;
|
||||
`.trim(),
|
||||
},
|
||||
{
|
||||
id: 24,
|
||||
type: 'template',
|
||||
title: 'dbdev',
|
||||
description: 'dbdev is a client for installing 3rd party packages into your database.',
|
||||
sql: `
|
||||
create extension if not exists http with schema extensions;
|
||||
create extension if not exists pg_tle;
|
||||
select pgtle.uninstall_extension_if_exists('supabase-dbdev');
|
||||
drop extension if exists "supabase-dbdev";
|
||||
select
|
||||
pgtle.install_extension(
|
||||
'supabase-dbdev',
|
||||
resp.contents ->> 'version',
|
||||
'PostgreSQL package manager',
|
||||
resp.contents ->> 'sql'
|
||||
)
|
||||
from http(
|
||||
(
|
||||
'GET',
|
||||
'https://api.database.dev/rest/v1/'
|
||||
|| 'package_versions?select=sql,version'
|
||||
|| '&package_name=eq.supabase-dbdev'
|
||||
|| '&order=version.desc'
|
||||
|| '&limit=1',
|
||||
array[
|
||||
('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header
|
||||
],
|
||||
null,
|
||||
null
|
||||
)
|
||||
) x,
|
||||
lateral (
|
||||
select
|
||||
((row_to_json(x) -> 'content') #>> '{}')::json -> 0
|
||||
) resp(contents);
|
||||
create extension "supabase-dbdev";
|
||||
select dbdev.install('supabase-dbdev');
|
||||
drop extension if exists "supabase-dbdev";
|
||||
create extension "supabase-dbdev";
|
||||
`.trim(),
|
||||
},
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user