Skip to content

Commit 8775c13

Browse files
committed
update readme
1 parent f1dac3a commit 8775c13

3 files changed

Lines changed: 101 additions & 6 deletions

File tree

Makefile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
# Copyright (C) 2019-2025 Ruohang Feng
88
#==============================================================#
99
VERSION=v1.0.0
10-
default: v d
10+
default: v dev
1111

1212
PGURL="postgres:///data"
1313

14-
# run next dev server (3000)
15-
d: dev
14+
# run hugo dev server (1313)
1615
dev:
1716
hugo serve
1817

18+
# quick release: build linux/amd64, ship to jp, restart service
19+
d: amd 2j rs
20+
1921
# building (SSG) - new optimized version
2022
b: build
2123
build:
@@ -115,8 +117,16 @@ arm:
115117
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LD_FLAGS)" -o pgext
116118
upx pgext
117119
amd:
118-
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o pgext
119-
upx pgext
120+
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o pgext
121+
122+
# ship binary to jp (atomic swap avoids ETXTBSY on the running daemon)
123+
2j:
124+
scp pgext jp:/usr/bin/pgext.new
125+
ssh jp 'chmod 755 /usr/bin/pgext.new && mv -f /usr/bin/pgext.new /usr/bin/pgext'
126+
127+
# restart pgext daemon on jp
128+
rs:
129+
ssh jp 'systemctl restart pgext && systemctl is-active pgext'
120130

121131
# inventory
122-
.PHONY: default run gen dump save load gen-json gen-mdx build-mdx
132+
.PHONY: default run gen dump save load gen-json gen-mdx build-mdx arm amd 2j rs d dev

README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# pgext
2+
3+
[![Website: pgext.cloud](https://img.shields.io/badge/website-pgext.cloud-336791?logo=postgresql&logoColor=white)](https://pgext.cloud)
4+
[![Docs: doc.pgext.cloud](https://img.shields.io/badge/docs-doc.pgext.cloud-4169E1)](https://doc.pgext.cloud)
5+
[![Release](https://img.shields.io/github/v/release/pgsty/pgext?color=teal)](https://github.com/pgsty/pgext/releases)
6+
[![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
7+
8+
**pgext** catalogs the PostgreSQL extension universe: 1,600+ extensions with metadata,
9+
dependencies, categories, and exact package availability across PostgreSQL versions,
10+
operating systems, and repositories (PGDG / Pigsty, APT / YUM).
11+
12+
It is a single static binary that does two things:
13+
14+
- **Build the catalog**: fetch repository metadata, parse APT/RPM packages, and
15+
maintain the curated extension knowledge base — all stored in PostgreSQL.
16+
- **Serve the catalog**: a self-contained web app + JSON API, the same software
17+
that powers [pgext.cloud](https://pgext.cloud).
18+
19+
## Quick Start
20+
21+
All you need is a PostgreSQL database to hold the catalog:
22+
23+
```bash
24+
export PGURL="postgres:///data" # where the catalog lives (default: postgres:///data)
25+
26+
pgext init # one-time setup: create the pgext schema and load catalog data
27+
pgext serve # web UI + JSON API at http://localhost:8432
28+
```
29+
30+
That's it. Point your browser at [http://localhost:8432](http://localhost:8432).
31+
32+
```bash
33+
pgext serve --db meta --listen :8080 # database name shorthand, custom port
34+
curl 'localhost:8432/api/v1/ext?q=vector' # query the JSON API
35+
```
36+
37+
## Installation
38+
39+
Download a single-binary release for Linux / macOS (amd64 / arm64) from the
40+
[release page](https://github.com/pgsty/pgext/releases), or `deb` / `rpm` packages
41+
if you prefer a package manager.
42+
43+
Build from source (Go 1.26+, no CGO required):
44+
45+
```bash
46+
git clone https://github.com/pgsty/pgext.git
47+
cd pgext && go build -o pgext .
48+
```
49+
50+
## Commands
51+
52+
```text
53+
pgext init # setup everything (schema + reload)
54+
pgext serve # serve web UI + JSON API (:8432)
55+
pgext status # show metadata status
56+
57+
pgext reload # reload data: fetch + complete parse
58+
pgext fetch # get repo metadata from upstream
59+
pgext scan # scan local Pigsty repo metadata
60+
pgext parse # atomically populate apt, dnf, bin, pkg
61+
pgext recap # rebuild pkg from current catalog data
62+
63+
pgext ext <name> # show extension information
64+
pgext pkg <name> # show package availability matrix
65+
pgext bin <name> -p 17 -o el9 # show binary packages with URLs
66+
67+
pgext gen all # run every content generator
68+
pgext pgxn # crawl PGXN dist metadata
69+
pgext purge # drop the pgext schema
70+
```
71+
72+
Run `pgext help <command>` for details on any command.
73+
74+
## Links
75+
76+
- Catalog website: [pgext.cloud](https://pgext.cloud)
77+
- Documentation: [doc.pgext.cloud](https://doc.pgext.cloud)
78+
- Pigsty — battery-included PostgreSQL distribution: [pigsty.io](https://pigsty.io)
79+
- `pig` — the PostgreSQL extension package manager: [github.com/pgsty/pig](https://github.com/pgsty/pig)
80+
81+
## License
82+
83+
[Apache License 2.0](LICENSE) © [Ruohang Feng](https://vonng.com)

server/web/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const I18N = {
113113
'nav.matrix': ['Matrix', '构建矩阵'],
114114
'nav.browse': ['Index', '扩展索引'],
115115
'nav.about': ['About', '关于'],
116+
'nav.docs': ['Docs', '文档'],
116117
'nav.lang': ['中文', 'EN'],
117118
'hero.eyebrow': ['pgext.cloud · everything postgresql can become', 'pgext.cloud · PostgreSQL 的一切可能'],
118119
'hero.title': ['<em>PostgreSQL</em> Extension Catalog', '<em>PostgreSQL</em> 扩展目录'],
@@ -1191,6 +1192,7 @@ function navHTML(active) {
11911192
+ dims.map(d => '<a href="' + dimHref(d) + '">' + t(DIMS[d].label) + '</a>').join('') + '</div>').join('')
11921193
+ '</div></span>'
11931194
+ '<a href="/about" aria-current="' + (active === 'about') + '">' + t('nav.about') + '</a>'
1195+
+ '<a href="https://doc.pgext.cloud" target="_blank" rel="noopener">' + t('nav.docs') + '</a>'
11941196
+ '</nav><span class="nav-spacer"></span><div class="nav-actions">'
11951197
+ '<div class="nav-search"><input id="nav-q" type="search" autocomplete="off" spellcheck="false" placeholder="'
11961198
+ esc(bi('Press / to search', '按 / 开始搜索')) + '" aria-label="search extensions"><kbd>/</kbd>'

0 commit comments

Comments
 (0)