{"repo":"cloudflare/worker-template-postgres","free":true,"listed":false,"github":"https://github.com/cloudflare/worker-template-postgres","clone":"git clone https://github.com/cloudflare/worker-template-postgres.git","description":"Reference demo and modified PostgreSQL driver to connect Cloudflare Workers to a relational database.","language":"JavaScript","stars":92,"topics":["database","postgres","sql","serverless","cloudflare","workers"],"license":"Apache-2.0","category":"databases-storage","readme_excerpt":"Cloudflare Workers + PostgreSQL This repo contains example code and a PostgreSQL driver that can be used in any Workers project. If you are interested in using the driver outside of this template, copy the driver/postgres module into your project's node modules or directly alongside your source. Usage Before you start, please refer to the official tutorial . Please Note: - you must use this config object format vs. a database connection string - the hostname property must be the URL to your Cloudflare Tunnel, NOT your database host - your Tunnel will be configured to connect to your database host Running the Postgres Demo postgres/docker-compose.yml This docker-compose composition will get you up and running with a local instance of postgresql , pgbouncer in front to provide connection pooling, and a copy of cloudflared to enable your applications to securely connect, through a encrypted tunnel, without opening any ports up locally. Usage from within scripts/postgres , run: 1. Create credentials file (first time only) 2. Start a local dev stack (cloudflared/pgbouncer/postgres)","default_branch":null,"files":null,"tree":[],"storefront":"/r/cloudflare","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/cloudflare/worker-template-postgres/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}