Trunk is an open source package manager and registry for Postgres extensions. Use the Trunk CLI to build, publish and install Postgres extensions of all kinds.
The Trunk CLI is hosted at crates.io and can be installed with cargo.
curl https://sh.rustup.rs -sSf | sh
cargo install pg-trunk
The Trunk CLI allows for building, publishing and installing Postgres extensions of all kinds. It abstracts away complexities of extension development and management with the following commands:
- Compile extensions of all kinds.
❯ trunk build
Building from path .
Detected that we are building a pgrx extension
Detected pgrx version range 0.7.4
Using pgrx version 0.7.4
Building pgrx extension at path .
.
.
.
Creating package at: ./.trunk/pgmq-0.5.0.tar.gz
Create Trunk bundle:
pgmq.so
extension/pgmq--0.5.0.sql
extension/pgmq.control
manifest.json
Packaged to ./.trunk/pgmq-0.5.0.tar.gz
- Publish extensions to the registry, making them available to the Postgres community for discovery and installation.
❯ trunk publish pgmq \
--version 0.5.0 \
--description "Message Queue for postgres" \
--documentation "https://github.com/tembo-io/pgmq" \
--repository "https://github.com/tembo-io/pgmq" \
--license "Apache-2.0" \
--homepage "https://www.tembo.io"
- Downloads Postgres extensions from the Trunk registry and installs in whichever environment trunk is run.
- Supports nested dependencies, e.g. installing
extension_a
will automatically installextension_b
if required.
❯ trunk install pgmq
Using pg_config: /usr/bin/pg_config
Using pkglibdir: "/usr/lib/postgresql/15/lib"
Using sharedir: "/usr/share/postgresql/15"
Downloading from: https://cdb-plat-use1-prod-pgtrunkio.s3.amazonaws.com/extensions/pgmq/pgmq-0.5.0.tar.gz
Dependencies: ["pg_partman"]
Installing pgmq 0.5.0
[+] pgmq.so => /usr/lib/postgresql/15/lib
[+] extension/pgmq--0.5.0.sql => /usr/share/postgresql/15
[+] extension/pgmq.control => /usr/share/postgresql/15
Trunk Registry - https://pgt.dev
The Trunk registry serves as the community's hub for Postgres extensions of all kinds. The Trunk CLI installs extensions and their dependencies as compiled artifacts from this registry.
- Extension discovery and search
- Publish extensions for community use
- Install extensions in Postgres
- Usage metrics to provide insight into popular and well-maintained extensions
- Version tracking and new release email notifications
Trunk is in active development, and we look forward to the contributions the Postgres community has to offer. If you're interested in contributing, please open a pull request, issue, or reach out:
- Slack
- Email us at [email protected]