© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3mo ago•
2 replies
Diego

What is the recommended drizzle client setup in edge functions?

I'm doing this:
import { drizzle } from 'npm:drizzle-orm/postgres-js';
import postgres from 'npm:postgres';

const connectionString = Deno.env.get('DATABASE_URL')!;
const postgres_client = postgres(connectionString, { prepare: false });
const postgres_db = drizzle(postgres_client);
import { drizzle } from 'npm:drizzle-orm/postgres-js';
import postgres from 'npm:postgres';

const connectionString = Deno.env.get('DATABASE_URL')!;
const postgres_client = postgres(connectionString, { prepare: false });
const postgres_db = drizzle(postgres_client);

The database url is initialized to the ipv4 compatible shared pooler and stored in that env variable

This works fine most of the time. However, I get timeout errors flakily. After digging a bit, turns out the initialization of the postgres client takes 150 seconds or so sometimes... My client times out

Is this a known issue? Has someone run into this, or what are recommendations to keep the initialization/connection time reliably low?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Using Type Safe Client in Edge Functions
SupabaseSSupabase / help-and-questions
3y ago
Edge Functions, Remix, Drizzle connecting nightmare HELP
SupabaseSSupabase / help-and-questions
3y ago
Directories in edge functions.
SupabaseSSupabase / help-and-questions
4y ago
Transactions in Edge Functions
SupabaseSSupabase / help-and-questions
4y ago