Skip to content

Commit de21166

Browse files
committed
update docs and ui with new command
1 parent 1ef4485 commit de21166

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

docs/install-a-package.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,26 @@ create extension if not exists pg_tle;
2121
Once the prerequisites are met, you can create a migration file to install a TLE available on database.dev by running the following dbdev command:
2222

2323
```bash
24-
dbdev add -c <postgres_connection_string> -o <migration_folder_path> package -n <package_name>
24+
dbdev add -o <migration_folder_path> -v <version> -s <schema> package -n <package_name>
25+
```
26+
27+
For example, to install `kiwicopple@pg_idkit` version 0.0.4 in `extensions` schema run:
28+
29+
```bash
30+
dbdev add -o "./migrations/" -v 0.0.4 -s extensions package -n kiwicopple@pg_idkit
2531
```
2632

27-
For example, to install `kiwicopple@pg_idkit` version 4.0.0 in `extensions` schema run:
33+
To create a migration file to update to the latest version of a package, you need to specify the `-c` flag with the connection string to your database. The connection is used to check the current version of the package installed in the database and generate a migration file that will update it to the latest version available on database.dev.
34+
35+
```bash
36+
dbdev add -c <postgres_connection_string> -o <migration_folder_path> package -n <package_name>
37+
```
38+
To update the `kiwicopple@pg_idkit` package to the latest version, you can run:
2839

2940
```bash
30-
dbdev add -c "postgresql://postgres:[YOUR-PASSWORD]@[YOUR-HOST]:5432/postgres" -o "./migrations/" -v 4.0.0 -s extensions package -n kiwicopple@pg_idkit
41+
dbdev add -c "postgresql://postgres:[YOUR-PASSWORD]@[YOUR-HOST]:5432/postgres" -o "./migrations/" package -n kiwicopple@pg_idkit
3142
```
3243

3344
!!! warning
3445

35-
Ensure that before running the `dbdev add` command, all existing migrations in the `migrations` folder have been applied to the database. The `dbdev add` command looks for existing installed extensions in the database and generates a migration file that will install the TLE if it is not already installed.
46+
To generate a correct update migration file, ensure that before running the `dbdev add` command, all existing migrations in the `migrations` folder have been applied to the database. The `dbdev add` command looks for existing installed extensions in the database and generates a migration file that will install the TLE if it is not already installed.

website/pages/[handle]/[package].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const PackagePage: NextPageWithLayout = () => {
4040

4141
const packageName = pkg?.package_alias ?? pkg?.package_name ?? 'Loading...'
4242
const packageVersion = pkg?.latest_version ?? '0.0.0'
43-
const addCommand = `dbdev add -c "postgresql://postgres:[YOUR-PASSWORD]@[YOUR-HOST]:5432/postgres" -o ./migrations -s extensions -v ${packageVersion} package -n "${packageName}"`
43+
const addCommand = `dbdev add -o ./migrations -s extensions -v ${packageVersion} package -n "${packageName}"`
4444

4545
const downloads30Days = pkg?.download_metrics?.downloads_30_day ?? 0
4646
const downloads90Days = pkg?.download_metrics?.downloads_90_days ?? 0

website/pages/index.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const IndexPage: NextPageWithLayout = () => {
5757
</div>
5858
</div>
5959
<div className="mt-4 md:mt-12 lg:-mt-16 lg:flex-shrink-0 md:text-center lg:text-left">
60-
<div className="relative border px-4 pt-4 pb-4 md:pb-24 rounded-md justify-end max-w-md lg:max-w-lg">
60+
<div className="relative border px-4 pt-4 pb-4 md:pb-24 rounded-md justify-end">
6161
<div>
6262
<div>
6363
<h3 className="text-lg font-bold">Download and install</h3>
@@ -68,9 +68,7 @@ const IndexPage: NextPageWithLayout = () => {
6868
<div className="mt-4 relative">
6969
<code className="block py-2 text-sm whitespace-pre-wrap break-words">
7070
<span className="text-muted-foreground">
71-
dbdev add -c
72-
&quot;postgresql://postgres:[YOUR-PASSWORD]@[YOUR-HOST]:5432/postgres&quot;
73-
-o ./migrations -s extensions -v 0.2.1 package -n &quot;
71+
dbdev add -o . package -n &quot;
7472
</span>
7573
<span>
7674
<span className="bg-slate-100 rounded-sm p-1 dark:bg-slate-700 relative">
@@ -98,7 +96,7 @@ const IndexPage: NextPageWithLayout = () => {
9896
</div>
9997
<CopyButton
10098
getValue={() =>
101-
`dbdev add -c "postgresql://postgres:[YOUR-PASSWORD]@[YOUR-HOST]:5432/postgres" -o ./migrations -s extensions -v 0.2.1 package -n "olirice@index_advisor"`
99+
`dbdev add -o . package -n "olirice@index_advisor"`
102100
}
103101
className="absolute top-2 right-2 p-1"
104102
variant="light"

0 commit comments

Comments
 (0)