Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

Credentials

1. Get Your Connection DSN

Local Postgres

# Default local instance
DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres

Managed Postgres (Supabase, Neon, RDS, …)

Copy the connection string from your provider’s dashboard. It usually looks like:
postgres://<user>:<password>@<host>:5432/<database>?sslmode=require

2. Set Environment Variables

# .env.development
DATABASE_URL=postgres://user:pass@host:5432/db?sslmode=require

Permissions

The Postgres resource is read-only. Grant the role you connect with at minimum:
GRANT USAGE ON SCHEMA public TO mirage_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO mirage_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO mirage_reader;
If you only want to expose a subset of schemas, set schemas in the resource config:
PostgresConfig(dsn=os.environ["DATABASE_URL"], schemas=["public", "analytics"])

Limits

The resource has built-in safety limits to keep an agent from accidentally pulling a whole table:
  • default_row_limit (1,000): default LIMIT applied to ad-hoc reads.
  • max_read_rows (10,000): hard ceiling per read.
  • max_read_bytes (10 MiB): hard ceiling per read.
  • default_search_limit (100): default LIMIT for search-style queries.
Override in the config if you need bigger reads.