Skip to main content
Neon is a fully managed serverless Postgres. Neon separates compute and storage to offer features such as autoscaling, branching, and bottomless storage.
Get started by creating a project directory, initializing the directory using bun init, and adding the Neon serverless driver as a project dependency.
terminal

Create a .env.local file and add your Neon Postgres connection string to it.
.env.local

Paste the following code into your project’s index.ts file.
index.ts

Start the program with bun ./index.ts. It prints the Postgres version to the console.
terminal

This example used the Neon serverless driver’s SQL-over-HTTP functionality. Neon’s serverless driver also exposes Client and Pool constructors to enable sessions, interactive transactions, and node-postgres compatibility. Refer to Neon’s documentation for a complete overview of the serverless driver.