Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
darioscrivano committed Feb 22, 2024
1 parent 197ecee commit 56b4e59
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions examples/golang-api-with-postgres-and-sqlc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,28 @@ cd backend-reference/examples/golang-api-with-postgres-and-sqlc
```

3. We are using [sqlc](https://docs.sqlc.dev/en/stable/index.html) to generate the queries and models.

Check failure on line 25 in examples/golang-api-with-postgres-and-sqlc/README.md

View workflow job for this annotation

GitHub Actions / Markdownlint / Markdown Lint

Ordered list item prefix [Expected: 1; Actual: 3; Style: 1/1/1]
To generate the queries run
To generate the queries run

```bash
sqlc generate
```

3. Build and run the Docker containers:
4. Build and run the Docker containers:

Check failure on line 32 in examples/golang-api-with-postgres-and-sqlc/README.md

View workflow job for this annotation

GitHub Actions / Markdownlint / Markdown Lint

Ordered list item prefix [Expected: 1; Actual: 4; Style: 1/1/1]

```bash
docker-compose build
```

4. Run the containers
5. Run the containers

Check failure on line 38 in examples/golang-api-with-postgres-and-sqlc/README.md

View workflow job for this annotation

GitHub Actions / Markdownlint / Markdown Lint

Ordered list item prefix [Expected: 1; Actual: 5; Style: 1/1/1]

```bash
docker-compose up
```



The Go API will be accessible at localhost:8080.

## Stopping the Application

To stop the application and remove the containers, networks, and volumes defined in docker-compose.yml, run the following command:

```bash
Expand Down
2 changes: 1 addition & 1 deletion examples/golang-api-with-postgres-and-sqlc/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ services:
depends_on:
- db
ports:
- "8080:8080"
- "8080:8080"
10 changes: 5 additions & 5 deletions examples/golang-api-with-postgres-and-sqlc/schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(30) NOT NULL,
password VARCHAR(100) NOT NULL,
email VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
id SERIAL PRIMARY KEY,
username VARCHAR(30) NOT NULL,
password VARCHAR(100) NOT NULL,
email VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
2 changes: 1 addition & 1 deletion examples/golang-api-with-postgres-and-sqlc/sqlc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ sql:
go:
package: "users"
out: "users"
sql_package: "pgx/v5" # you can use "database/sql" or "pgx/v5"
sql_package: "pgx/v5" # you can use "database/sql" or "pgx/v5"

0 comments on commit 56b4e59

Please sign in to comment.