Basic Operations
The SDK uses a Supabase-like query builder that feels natural to JavaScript developers:Querying Data
Inserting Data
Updating Data
Deleting Data
Advanced Filtering
The SDK supports all PostgREST operators through chainable methods:Complex Queries
Relationships & Joins
The SDK supports PostgREST’s powerful join syntax:Counting & Pagination
Get total counts alongside your data:Error Handling
The SDK provides structured error responses:Data Types
The SDK validates data types but does NOT automatically convert JavaScript types. You must provide correctly formatted values:JavaScript Input | PostgreSQL Type | Required Format |
---|---|---|
string | TEXT | Any string value |
number | INTEGER | Whole numbers only (-2147483648 to 2147483647) |
number | DOUBLE PRECISION | Floating point numbers |
boolean | BOOLEAN | true or false |
string | DATE | 'YYYY-MM-DD' format |
string | TIMESTAMPTZ | ISO 8601 format (e.g., '2024-01-15T10:30:00Z' ) |
string | UUID | Valid UUID format |
object/array | JSONB | JSON-serializable objects/arrays |
null | NULL | null value |
Important:
- Dates must be provided as ISO 8601 strings, not JavaScript Date objects
- Empty strings are converted to
null
for non-text types - The backend uses
TEXT
(notVARCHAR
) for all string columns - All timestamps are stored with timezone (
TIMESTAMPTZ
)
System Tables
Access system tables (read-only for user data):To modify user data, use the auth methods like
insforge.auth.setProfile()
. The system restricts each user to only update their own data - users cannot delete their own records or modify other users’ data.Best Practices
Handle Errors
Always check the
error
object from every operationUse Select
Add
.select()
to INSERT/UPDATE/DELETE to get affected recordsBatch Operations
Insert multiple records in one call when possible
Optimize Queries
Select only needed columns to reduce payload size