db

command
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

README

DB for testing

Run postgresql container

docker run --rm --name postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=tfgrid-graphql \
  -p 5432:5432 -d postgres

Create the DB

you can either Generate a db with relevant schema to test things locally quickly, or load a previously taken DB dump file:

Method 1: Generate a db with relevant schema using the db helper tool:
```bash
cd tools/db/ && go run . \
  --postgres-host 127.0.0.1 \
  --postgres-db tfgrid-graphql \
  --postgres-password postgres \
  --postgres-user postgres \
  --reset \
```
Method 2: Fill the DB from a Production db dump file, for example if you have dump.sql file, you can run:
```bash
psql -h 127.0.0.1 -U postgres -d tfgrid-graphql  < dump.sql
```

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL