Page:
backend postgres Overview
Pages
Home
ai Overview
ai gemini Overview
api HowTo
api Overview
api client HowTo
api client Overview
api server HowTo
api server Overview
api server express HowTo
app HowTo
app Overview
auth HowTo
auth Overview
auth basic HowTo
auth basic Overview
auth firebase HowTo
auth firebase Overview
auth oidc Overview
auth pocketbase HowTo
auth pocketbase Overview
auth supabase HowTo
auth supabase Overview
backend HowTo
backend Overview
backend firestore Overview
backend migrations Overview
backend postgres Overview
backend restapi Overview
backend restapi recipes Overview
backend sqlite HowTo
backend sqlite Overview
cache Overview
cache redis Overview
cloudwrapper HowTo
cloudwrapper Overview
cloudwrapper firebase HowTo
cloudwrapper firebase Overview
cloudwrapper supabase HowTo
cloudwrapper supabase Overview
code Overview
code github Overview
core HowTo
core Overview
core cli HowTo
core cli Overview
gateway upstream express HowTo
gateway upstream express Overview
i18n HowTo
i18n Overview
i18n en HowTo
i18n en Overview
i18n fr HowTo
i18n fr Overview
log HowTo
log Overview
messaging HowTo
messaging Overview
messaging firebase HowTo
messaging firebase Overview
queue HowTo
queue Overview
queue amqp HowTo
queue amqp Overview
queue aws HowTo
queue aws Overview
queue gcp HowTo
queue gcp Overview
storage HowTo
storage Overview
storage firebase HowTo
storage firebase Overview
storage local Overview
storage s3 HowTo
storage s3 Overview
storage supabase HowTo
storage supabase Overview
studio Overview
testing Overview
types HowTo
types Overview
ui Overview
ui form react Overview
ui list HowTo
ui list Overview
ui list react HowTo
ui list react Overview
worker HowTo
worker Overview
No results
2
backend postgres Overview
GitHub Action edited this page 2026-04-21 19:26:34 +00:00
Table of Contents
@quatrain/backend-postgres
A backend adapter for PostgreSQL. This package is optimized for use with Supabase but works with any standard PostgreSQL database.
Features
- Implements the
@quatrain/backendabstract adapter. - Full SQL support for complex queries, transactions, and joins.
- Uses the
pg(node-postgres) library for high performance. - Includes scripts and guidance for setting up the required database schema.
Installation
npm install @quatrain/backend-postgres pg
Usage
import { Backend } from '@quatrain/backend'
import { PostgresAdapter } from '@quatrain/backend-postgres'
const adapter = new PostgresAdapter({ config: { connectionString: '...' } })
Backend.addAdapter(adapter, 'default', true)
Timezone Handling
All TIMESTAMP WITHOUT TIME ZONE values are interpreted as UTC. The adapter configures the pg driver's type parsers to return timestamps as ISO8601 strings with the Z suffix, ensuring consistent timezone handling regardless of the server's local timezone.
This means:
- Timestamps stored in the database (e.g.,
2026-02-06 08:24:06.034) are treated as UTC - The adapter returns them as
2026-02-06T08:24:06.034Zfor proper parsing - Frontend applications can then convert to the user's local timezone for display
Documentation
For concrete examples and usage guides, please refer to the How-To Guide.
License
AGPL-3.0-only
Core Documentation
Foundations
Storage, Data & Cache
- backend
- backend-firestore
- backend-postgres
- backend-sqlite
- backend-migrations
- storage
- storage-firebase
- storage-s3
- storage-supabase
- storage-local
- cache
- cache-redis
Queue & Messaging
Auth & Cloud
- auth
- auth-firebase
- auth-supabase
- auth-oidc
- auth-pocketbase
- cloudwrapper
- cloudwrapper-firebase
- cloudwrapper-supabase