diff options
| -rw-r--r-- | .env.bolt-postgres | 6 | ||||
| -rwxr-xr-x | bolt | 2 | ||||
| -rw-r--r-- | bolt.toml | 9 | ||||
| -rw-r--r-- | docker-compose.yml | 8 | ||||
| -rw-r--r-- | internal/storage/db.go | 4 |
5 files changed, 10 insertions, 19 deletions
diff --git a/.env.bolt-postgres b/.env.bolt-postgres new file mode 100644 index 0000000..af4ec5e --- /dev/null +++ b/.env.bolt-postgres @@ -0,0 +1,6 @@ +BOLT_CONNECTION_DBNAME=test_db +BOLT_CONNECTION_HOST=bolt_postgres_db +BOLT_CONNECTION_PORT=5432 +BOLT_CONNECTION_USER=test_user +BOLT_CONNECTION_PASSWORD=testpassword +BOLT_CONNECTION_DRIVER=postgres @@ -0,0 +1,2 @@ +#!/bin/sh +env $(cat .env.bolt-postgres | xargs) go run ./cmd/bolt/bolt.go diff --git a/bolt.toml b/bolt.toml deleted file mode 100644 index 0a40fa9..0000000 --- a/bolt.toml +++ /dev/null @@ -1,9 +0,0 @@ -migrations_dir = "migrations" - -[connection] -host = "localhost" -port = 5839 -user = "test_user" -password = "testpassword" -dbname = "test_db" -driver = "postgres" diff --git a/docker-compose.yml b/docker-compose.yml index d6c4384..b4d3679 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,6 @@ services: context: . volumes: - ./:/app - networks: - - app depends_on: - postgres_db @@ -26,13 +24,7 @@ services: - POSTGRES_PASSWORD=${DB_PASSWORD:?err} volumes: - postgres_db_volume:/var/lib/postgresql/data - networks: - - app volumes: postgres_db_volume: name: postgres-db-volume - -networks: - app: - name: app diff --git a/internal/storage/db.go b/internal/storage/db.go index 25db283..9032dc3 100644 --- a/internal/storage/db.go +++ b/internal/storage/db.go @@ -12,8 +12,8 @@ import ( // and connection information. // // Note that only "postgres" is supported as the driver right now. -func DBConnect(driver string, connectionInfo string) (*sql.DB, error) { - db, err := sql.Open(driver, connectionInfo) +func DBConnect(driver string, connectionParams string) (*sql.DB, error) { + db, err := sql.Open(driver, connectionParams) if err != nil { return nil, err } |