new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Supabase · Database · all subjects

connecting/serverless

7 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

supabase-js for serverless environments

supabase-js is an isomorphic JavaScript client that uses the auto-generated REST API and works in any environment that supports HTTPS connections. The REST API has a built-in connection pooler and can serve thousands of simultaneous requests, making it ideal for serverless workloads.

Vercel Edge Functions connection setup

To connect Vercel Edge Functions to Supabase Postgres, copy the URI from the Database Settings Transaction pooler section, save it as POSTGRES_URL environment variable, replace the password placeholder with the actual database password, and add the suffix ?workaround=supabase-pooler.vercel. An example connection string format is: postgres://postgres.cfcxynqnhdybqtbhjemm:[YO••••••D]@aws-0-ap-southeast-1.pooler.supabase.com:6543/postgres?workaround=supabase-pooler.vercel

Vercel Edge Functions supported drivers

Vercel Edge Functions can use supabase-js, Drizzle ORM, and Kysely for database connections. Vercel provides deploy templates and integration to automatically configure connection strings as environment variables.

Cloudflare Workers database options

Cloudflare Workers runtime supports connecting to Postgres using supabase-js, Postgres.js, or node-postgres. The Workers runtime uses the V8 engine and provides polyfills for a subset of Node.js APIs and TCP Sockets API.

Supabase Edge Functions database options

Supabase Edge Functions uses the Deno runtime which has native support for TCP connections. Supported clients include supabase-js, Deno Postgres driver, Postgres.js, and Drizzle.

Drizzle ORM setup with Vercel Postgres

When using Drizzle ORM with Vercel Postgres and Supabase, import sql from @vercel/postgres, define your table schema using drizzle-orm/pg-core, and initialize the connection with drizzle(sql). Example: import { drizzle } from 'drizzle-orm/vercel-postgres'; export const db = drizzle(sql)

Kysely setup with Vercel Postgres

When using Kysely with Vercel Postgres and Supabase, import createKysely from @vercel/postgres-kysely, define database interfaces with table schemas using ColumnType for select/insert/update operations, use Generated type for database-generated columns, and initialize with createKysely<Database>(). Example: const db = createKysely<Database>()

Give your agent this brain