This release is a pre-release and may not be stable for production use.
Gold Lapel
Self-optimizing Postgres proxy — automatic materialized views and indexes, with an L1 native cache that serves repeated reads in microseconds. Zero code changes required.
Gold Lapel sits between your app and Postgres, watches query patterns, and automatically creates materialized views and indexes to make your database faster. Port 7932 (79 = atomic number for gold, 32 from Postgres).
Install
pip install goldlapel
# or
uv pip install goldlapel
Quick Start
import goldlapel
# Create a proxy instance and start it
gl = goldlapel.GoldLapel("postgresql://user:pass@localhost:5432/mydb")
gl.start()
# Use the proxy connection directly — no driver setup needed
result = gl.execute("SELECT * FROM users WHERE id = $1", [42])
For async applications:
import goldlapel
gl = goldlapel.GoldLapel("postgresql://user:pass@localhost:5432/mydb")
await gl.start_async()
result = await gl.fetch("SELECT * FROM users WHERE id = $1", 42)
Gold Lapel prints the proxy and dashboard URLs on startup. Access the dashboard programmatically:
gl.dashboard_url() # http://127.0.0.1:7933
API
goldlapel.GoldLapel(upstream, config=None, port=None, extra_args=None)
Creates a Gold Lapel proxy instance.
upstream— your Postgres connection string (e.g.postgresql://user:pass@localhost:5432/mydb)config— dict of configuration options (see Configuration)port— proxy port (default: 7932)extra_args— additional CLI flags passed to the binary (e.g.["--threshold-impact", "5000"])
gl.start()
Starts the proxy. Returns the instance for chaining.
gl.start_async()
Async version of start().
gl.stop()
Stops the proxy. Also called automatically on process exit.
gl.proxy_url()
Returns the current proxy URL, or None if not running.
gl.dashboard_url()
Returns the dashboard URL (e.g. http://127.0.0.1:7933), or None if the proxy is not running or the dashboard is disabled.
goldlapel.config_keys()
Returns the set of all valid config key names.
Configuration
Pass a config dict to the constructor to configure the proxy:
import goldlapel
gl = goldlapel.GoldLapel("postgresql://user:pass@localhost/mydb", config={
"mode": "waiter",
"pool_size": 50,
"disable_matviews": True,
"replica": ["postgresql://user:pass@replica1/mydb"],
})
gl.start()
Keys use snake_case and map directly to CLI flags (pool_size → --pool-size). Boolean keys like disable_matviews are flags — True enables them, False (or omitting) leaves them off. List keys like replica accept arrays and produce repeated flags.
Unknown keys raise ValueError immediately. To see all valid keys:
import goldlapel
print(goldlapel.config_keys())
For the full configuration reference, see the main documentation.
You can also set environment variables (GOLDLAPEL_PROXY_PORT, GOLDLAPEL_UPSTREAM, etc.) — the binary reads them automatically.
How It Works
This package bundles the Gold Lapel Rust binary for your platform. When you call start(), it:
- Locates the binary (bundled in package, on PATH, or via
GOLDLAPEL_BINARYenv var) - Spawns it as a subprocess listening on localhost
- Waits for the port to be ready
- Returns a database connection with L1 native cache built in
- Cleans up automatically on process exit
The binary does all the work — this wrapper just manages its lifecycle.
Links
Release files for goldlapel 0.1.0rc25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| goldlapel-0.1.0rc25-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| goldlapel-0.1.0rc25-py3-none-musllinux_1_2_x86_64.whl | Python 3 | none | Linux musl 1.2+ x86-64 | Details |
| goldlapel-0.1.0rc25-py3-none-musllinux_1_2_aarch64.whl | Python 3 | none | Linux musl 1.2+ ARM64 | Details |
| goldlapel-0.1.0rc25-py3-none-manylinux_2_31_x86_64.whl | Python 3 | none | Linux glibc 2.31+ x86-64 | Details |
| goldlapel-0.1.0rc25-py3-none-manylinux_2_31_aarch64.whl | Python 3 | none | Linux glibc 2.31+ ARM64 | Details |
| goldlapel-0.1.0rc25-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
| goldlapel-0.1.0rc25-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details |
Total release size: 75.5 MB
Release files / goldlapel-0.1.0rc25-py3-none-win_amd64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-win_amd64.whl |
|---|---|
| Size | 10.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
0167da4c9f4bd363b979d8546a0d9e639c3846768dd0fc261a72eedb2dd36a8f
|
|
BLAKE2b-256 checksum How to use checksums |
64c142f82b070724d0d51a8701618979689cf66070ef3821577d484f5a460e49
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-musllinux_1_2_x86_64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 11.9 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
cb07d9c199ea7c738860bfa43a20d8fae9ae021aa40d431a1394e7775a258d94
|
|
BLAKE2b-256 checksum How to use checksums |
7a68e14594fdfc03f68916d575a48e871689b1b416d967c01b96f9d5dc22edec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-musllinux_1_2_aarch64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
6424e58ad3e0e51da8d2216251a5e721afc6ecb03c954307ea1212539a3c7c65
|
|
BLAKE2b-256 checksum How to use checksums |
5989e3967aee54cf68c9b3063cc8b649eb97f0683b506630c6938be1658ce8d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-manylinux_2_31_x86_64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-manylinux_2_31_x86_64.whl |
|---|---|
| Size | 11.8 MB |
| Tags | Linux glibc 2.31+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ad05ad73e4e9f1f65cb08059e8ce6af9753d844ccf920e86e8aff199864d40c1
|
|
BLAKE2b-256 checksum How to use checksums |
3d9016719e64c193e1d1c8f8e878e48799ae2bc8e1d6afff68130e0bfeca93ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-manylinux_2_31_aarch64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-manylinux_2_31_aarch64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | Linux glibc 2.31+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
02f9aaf2dd2d4097c81d8fd3963633ed644bb1f42be81ca3eccef7d350a9a80a
|
|
BLAKE2b-256 checksum How to use checksums |
98c7a82b5619280d00938a67ac30a280a369c8bc2d8a945a938c0219e2748821
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-macosx_11_0_arm64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 9.5 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
cef824ac8668becda93eb39355b1aa1b95b25e93074bb6edd0d5c8f5e3459994
|
|
BLAKE2b-256 checksum How to use checksums |
6ab1c0a763142bf4040dcba1ac5c80c4c39fdc36c8f7477c40a29ac33e0f8b24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / goldlapel-0.1.0rc25-py3-none-macosx_10_13_x86_64.whl
| Download URL | goldlapel-0.1.0rc25-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 10.7 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
0b0f6fad15de714f305c55d4bc9a73979d18b17dc840afa7898022f40043813a
|
|
BLAKE2b-256 checksum How to use checksums |
4e1954d99f46b918a5df7ffe802953da875908656307f01874579aa318f7efb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|