N
Neon15mo ago
inland-turquoise

How does the neon client work?

Does this code snippet create a constant connection to the neon database? Or it only connects when it executes a query:
import { neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";

const sql = neon("...");

export const db = drizzle(sql);
import { neon } from "@neondatabase/serverless";
import { drizzle } from "drizzle-orm/neon-http";

const sql = neon("...");

export const db = drizzle(sql);
2 Replies
ratty-blush
ratty-blush15mo ago
Hey! It's an http client, so it creates an http connection on query
inland-turquoise
inland-turquoiseOP15mo ago
Thanks for clarifying!

Did you find this page helpful?