blob: d090d49998cec72df436db14c1e0c46da884e8f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
---
title: "temp-postgres 0.4.0"
description: "A major UX upgrade for the temporary PostgreSQL server."
published: 2026-04-30
---
[temp-postgres](https://git.skreutz.com/temp-postgres.git/) is a small utility to run the PostgreSQL server off a temporary directory.
It's been almost six years since the [initial release](/posts/temporary-postgresql-server).
The new version completes a major upgrade in terms of user experience and implementation:
* Rewritten in async Rust to improve error and signal handling
* UNIX-style command wrapper option
* Structured logging (also known as tracing)
* Graceful shutdown with configurable timeout
* Experimental Nix flake support
Some examples from the [readme](https://git.skreutz.com/temp-postgres.git/tree/README.md), also available on [crates.io](https://crates.io/crates/temp-postgres-command) and [lib.rs](https://lib.rs/crates/temp-postgres-command):
```sh
# Install temp-postgres using Cargo.
cargo install temp-postgres-command
# Run temp-postgres using Nix.
nix run git+https://git.skreutz.com/temp-postgres.git -- --help
# Optionally with a fixed PostgreSQL major version.
nix run git+https://git.skreutz.com/temp-postgres.git#temp-postgres_18 -- --help
# Wrap the psql command for an interactive terminal. No configuration necessary.
temp-postgres -- psql
# Run SQLx integration tests against a temporary database.
temp-postgres -- cargo test
# Create a symbolic link to enable static configuration.
temp-postgres --symlink db
psql --host "$(realpath db)"
```
See the [changelog](https://git.skreutz.com/temp-postgres.git/tree/CHANGELOG.md) for details.
|
for my tech blog and contact information.