Skip to content

Commit 137c21c

Browse files
committed
remove installer page and redirect it to /supabase/dbdev
1 parent 7ef9daa commit 137c21c

File tree

2 files changed

+11
-78
lines changed

2 files changed

+11
-78
lines changed

website/pages/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const IndexPage: NextPageWithLayout = () => {
9090
<p className="dark:text-white">
9191
Install the dbdev client in your PostgreSQL database by following
9292
the guide{' '}
93-
<Link href="/installer" className="border-b">
93+
<Link href="https://supabase.github.io/dbdev/install-in-db-client/" className="border-b">
9494
here
9595
</Link>
9696
. Publish your own trusted language extension by following{' '}

website/pages/installer.tsx

+10-77
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,20 @@
11
import Head from 'next/head'
2+
import { useRouter } from 'next/router'
23
import Layout from '~/components/layouts/Layout'
34
import Markdown from '~/components/ui/Markdown'
45
import { NextPageWithLayout } from '~/lib/types'
56

67
const InstallerPage: NextPageWithLayout = () => {
7-
return (
8-
<>
9-
<Head>
10-
<title>Installer | The Database Package Manager</title>
11-
</Head>
12-
13-
<div className="mb-16">
14-
<Markdown>
15-
{`# Install dbdev
16-
17-
To install the dbdev extension into your database, ensure you have the following dependencies installed and then run the following SQL:
18-
19-
Requires:
20-
- pg_tle: https://github.com/aws/pg_tle
21-
- pgsql-http: https://github.com/pramsey/pgsql-http
22-
23-
*If your database is running on [Supabase](https://supabase.com), these dependencies are already installed.*
24-
25-
\`\`\`sql
26-
create extension if not exists http with schema extensions;
27-
create extension if not exists pg_tle;
28-
select pgtle.uninstall_extension_if_exists('supabase-dbdev');
29-
drop extension if exists "supabase-dbdev";
30-
select
31-
pgtle.install_extension(
32-
'supabase-dbdev',
33-
resp.contents ->> 'version',
34-
'PostgreSQL package manager',
35-
resp.contents ->> 'sql'
36-
)
37-
from http(
38-
(
39-
'GET',
40-
'https://api.database.dev/rest/v1/'
41-
|| 'package_versions?select=sql,version'
42-
|| '&package_name=eq.supabase-dbdev'
43-
|| '&order=version.desc'
44-
|| '&limit=1',
45-
array[
46-
('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header
47-
],
48-
null,
49-
null
50-
)
51-
) x,
52-
lateral (
53-
select
54-
((row_to_json(x) -> 'content') #>> '{}')::json -> 0
55-
) resp(contents);
56-
create extension "supabase-dbdev";
57-
select dbdev.install('supabase-dbdev');
58-
drop extension if exists "supabase-dbdev";
59-
create extension "supabase-dbdev";
60-
\`\`\`
61-
62-
## Use
63-
64-
Once the client is installed, you an install a TLE available on [database.dev](https://database.dev/) by running SQL that looks like the following:
65-
66-
\`\`\`sql
67-
select dbdev.install(<extension_name>);
68-
create extension <extension_name>
69-
schema <schema>
70-
version <version>;
71-
\`\`\`
72-
73-
For example, to install [pg_headerkit](https://database.dev/burggraf/pg_headerkit) version \`1.0.0\` in schema \`public\` run:
8+
return null
9+
}
7410

75-
\`\`\`sql
76-
select dbdev.install('burggraf-pg_headerkit');
77-
create extension "burggraf-pg_headerkit"
78-
schema 'public'
79-
version '1.0.0';
80-
\`\`\``}
81-
</Markdown>
82-
</div>
83-
</>
84-
)
11+
export async function getServerSideProps() {
12+
return {
13+
redirect: {
14+
destination: '/supabase/dbdev',
15+
permanent: true,
16+
},
17+
}
8518
}
8619

8720
InstallerPage.getLayout = (page) => <Layout>{page}</Layout>

0 commit comments

Comments
 (0)