# edge-sql A short, to the point summary of steps outlined in: https://docs.edge-infra.dev/edge/implementation/edge-sql/ # Setting up a local database Steps to initialize a local postgres database with the edge schema and migrations, for use in local development or integration testing ## Prereqs 1. A local postgres server with the pg_cron extension installed Create an alias or add `psql` to PATH. I used: `alias psql=/Applications/Postgres.app/Contents/Versions/latest/bin/psql` Create `edge` database and enable `pg_cron`: `psql --command='CREATE DATABASE edge'` `psql --command='CREATE EXTENSION IF NOT EXISTS pg_cron;' --dbname='edge'` Run `edge-sql` to run migrations and set up database: `SQL_CONNECTION_NAME=localhost SQL_PORT=5432 SQL_USER=postgres SQL_PASSWORD=postgres SQL_DB_NAME=edge TOP_LEVEL_PROJECT_ID=localhost bazel run //cmd/edge/edge-sql` Then, start API server following the steps in `pkg/edge/api/README.md` or point any other program with a database connection to localhost:5432