How do I write an api request to get data from databsase?

Hallo community!

How do I write an API request to get data from my db?
Didn’t find any documentation nor a simple example for it. In the documentation I can only find how to create, updates and change db generally. There is nothing on the level of tables.

Thank You very much

Hey, @amyria3.

Neon exposes the usual Postgres protocol outside. It means you have API endpoints that allow you to manipulate the state of Neon entities (e.g., Projects, Branches, Endpoints, etc.). And then, you need to connect to the specific endpoint and run queries inside if you are working with the usual Postgres setup.

Meantime, we shipped @neondatabase/serverless - npm. It’s a JS library that enables you to execute queries via WebSockets.

1 Like

Thank You very much!
it seems like neondatabase/serverless is for vercel, while I am using vite. Do U have an idea what setup may work for me?

Hey @amyria3 :wave:. Are you using Vite with React for your frontend and are asking what to use for the backend?