Documentation Index
Fetch the complete documentation index at: https://mintlify.com/InsForge/InsForge/llms.txt
Use this file to discover all available pages before exploring further.
Overview
InsForge provides a PostgreSQL database with automatic REST API generation using PostgREST-style endpoints. Every table you create instantly gets CRUD endpoints with filtering, sorting, and pagination.Key Features
- Instant REST APIs - Auto-generated endpoints for all tables
- PostgREST-style Queries - Powerful filtering with
eq,gt,lt,like, etc. - Row Level Security - Fine-grained access control at the database level
- pgvector Support - Built-in vector embeddings for AI applications
- Relationships - Foreign keys and automatic joins
- Real-time Subscriptions - Listen to database changes via WebSockets
Table Management
Creating Tables
Create tables via the API with automaticid, createdAt, and updatedAt fields:
Supported Column Types
| Type | PostgreSQL | Description |
|---|---|---|
string | TEXT | Variable-length text |
integer | INTEGER | Whole numbers |
float | DOUBLE PRECISION | Decimal numbers |
boolean | BOOLEAN | True/false values |
datetime | TIMESTAMP WITH TIME ZONE | Date and time |
uuid | UUID | Universally unique identifier |
json | JSONB | JSON data |
file | TEXT | File URLs from storage |
Getting Table Schema
CRUD Operations
All CRUD operations use the TypeScript SDK with the{data, error} response structure.
Query Records (SELECT)
Filter Operators
| Operator | Method | Example |
|---|---|---|
| Equal | .eq('field', value) | status=eq.active |
| Not equal | .neq('field', value) | status=neq.draft |
| Greater than | .gt('field', value) | age=gt.18 |
| Greater or equal | .gte('field', value) | score=gte.50 |
| Less than | .lt('field', value) | price=lt.100 |
| Less or equal | .lte('field', value) | quantity=lte.10 |
| Pattern match | .like('field', pattern) | name=like.*John* |
| In array | .in('field', [values]) | status=in.(active,pending) |
| Is null | .is('field', null) | deletedAt=is.null |
Create Records (INSERT)
Insert requests must be an array, even for single records.
Update Records (UPDATE)
Delete Records (DELETE)
Response Headers
Query endpoints return useful headers:X-Total-Count- Total number of matching recordsContent-Range- Range of records returned (e.g., “0-99/1234”)
pgvector for Embeddings
InsForge includes pgvector for storing and querying vector embeddings.Creating a Table with Embeddings
Storing Embeddings
Similarity Search
Query similar vectors using SQL functions:Vector operators:
<=>- Cosine distance<->- Euclidean distance<#>- Inner product
Row Level Security (RLS)
RLS provides database-level access control per row.Architecture
Example: User-owned Posts
API Reference
Base URL
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Max records (1-1000, default 100) |
offset | integer | Skip records (pagination) |
order | string | Sort order (e.g., “createdAt.desc”) |
select | string | Columns to return (comma-separated) |
{field} | string | Filter by field (e.g., “status=eq.active”) |
Error Responses
400- Invalid query parameters404- Table not found422- Validation error (invalid field type)
Best Practices
Always Use Arrays for Insert
Even for single records, wrap in array:
insert([{...}])Use .select() to Get Created Data
Chain
.select() after insert/update to return the modified recordsEnable RLS for User Data
Protect sensitive data with Row Level Security policies
Index Frequently Queried Columns
Add indexes for columns used in WHERE clauses and joins
Use Foreign Keys
Maintain data integrity with foreign key constraints
Next Steps
Authentication
Secure your data with user authentication
Real-time
Subscribe to database changes
AI Integration
Generate embeddings for similarity search
Functions
Add custom business logic