Skip to content

Package manager for Postgres extensions

License

Notifications You must be signed in to change notification settings

kianmeng/postgres-trunk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trunk

version OSSRank Discord Chat

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.

trunk-install-larger-font

Installation

The Trunk CLI is hosted at crates.io and can be installed with cargo.

  1. curl https://sh.rustup.rs -sSf | sh
  2. cargo install pg-trunk

Trunk CLI

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:

trunk build

  • 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

trunk publish

  • 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://tembo-io.github.io/coredb/extensions/pgmq" \
--repository "https://github.com/tembo-io/coredb" \
--license "Apache-2.0" \
--homepage "https://www.coredb.io"

trunk install

  • 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 install extension_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://pgtrunk.io

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

Contributing

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:

About

Package manager for Postgres extensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 68.2%
  • TypeScript 14.7%
  • Shell 7.5%
  • SCSS 6.9%
  • Dockerfile 2.3%
  • JavaScript 0.2%
  • Just 0.2%