Connect to PostgreSQL with full async support, extensions, and vector search.
Prax supports PostgreSQL extensions through the datasource block in your schema.
Extensions are automatically created during migrations.
schema.prax: Declares what database features to use (provider, extensions)
prax.toml: Configures how to connect (URL, pool settings, credentials)
Prax generates CREATE EXTENSION statements at the beginning of migrations:
Prax provides native support for pgvector types for AI/ML embeddings and similarity search.
| Type | Rust Type | Storage | Use Case |
|---|---|---|---|
| {{ row.type }} | {{ row.rust }} | {{ row.storage }} | {{ row.use }} |
Vector indexes enable fast approximate nearest neighbor (ANN) search. Choose the right index type based on your dataset size and quality requirements.
Hierarchical Navigable Small World - Best recall, recommended for most use cases.
Inverted File with Flat quantization - Faster builds, good for large datasets.
| Aspect | HNSW | IVFFlat |
|---|---|---|
| {{ row.aspect }} | {{ row.hnsw }} | {{ row.ivfflat }} |
Choose the distance metric that matches your embedding model. Most text embeddings (OpenAI, Cohere) are normalized and work best with Cosine distance.
| Operation | PostgreSQL Ops | Operator | Best For |
|---|---|---|---|
| {{ row.op }} | {{ row.pgOps }} | {{ row.operator }} | {{ row.best }} |
Use the generated query builder to perform similarity search.
Prax generates optimized SQL for vector indexes during migrations.