For example, if you are using Prisma deployed to a Serverless environment. Direct connections are on port 5432.Ĭonnection pools are useful for managing a large number of temporary connections. Find your Connection Info and Connection String.You can connect to the database using any tool which supports Postgres. Direct connections #Įvery Supabase project provides a full Postgres database. You can find the API URL and Keys in the Dashboard. To do that you can use the dashboard or connect directly to your database. You cannot manage the database schema via the API (for security reasons). Realtime: listen to database changes over websockets.GraphQL: interact with your database through a GraphQL interface.REST: interact with your database through a REST interface.We provides several types of API to suit your preferences and use-case: This is the easiest way to get started if you are managing data (fetching, inserting, updating). a serverless environment)? If yes, use a connection pool. Are you connecting to your database and then disconnecting immediately (e.g.Are you connecting to a database and maintaining a connection? If yes, use a direct connection.You can use these simple questions to determine which connection method to use: Why would you use a connection pool? Primarily because the way that Postgres handles connections isn't very scalable for a large number of temporary connections. The API server internally handles a connection pool. You should use this for all browser and application interactions. The API is an auto-generated REST interface.You should use this for serverless functions and tools which disconnect from the database frequently. A "connection pool" is a system (external to Postgres) which keeps connections "open".You should use this for tools which are always alive - usually installed on a long-running server. A "direct connection" is when a connection is made to the database using Postgres' native connection implementation.Direct connections using Postgres' standard connection system.Supabase provides several options for programmatically connecting to your Postgres database: Types of Connection #
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |