Skip to content

Commit 510a245

Browse files
authored
feat/initial version (#1)
* feat(gitignore): Add .gitignore file to exclude build artifacts and environment files * feat: Implement PostgreSQL client and tools for MCP integration * feat: Add Taskfile for build, test, and linting tasks * feat: Add VSCode settings for YAML custom tags and Go linting * feat: Add FUNDING.yml to specify GitHub funding information * feat: add logger tests * feat: update app logic for database connection handling * tests: Add comprehensive tests for application functionality and command line handling * chore: update go.mod and go.sum with additional indirect dependencies * feat: enhance error handling and validation in DescribeTable and ExplainQuery methods * doc: update README with installation instructions for project configuration * feat: add GitHub Actions workflow for running tests with PostgreSQL service * chore: remove health check options for PostgreSQL service in GitHub Actions workflow * chore: remove PostgreSQL service configuration from GitHub Actions workflow * chore: update GitHub Actions workflow to install Go and remove unused caching strategy * feat: add GitHub Actions workflow for creating snapshot releases * feat: add GitHub Actions workflow for vulnerability scanning * feat: add GitHub Actions workflow for generating coverage badges * feat: add tasks for creating snapshot and regular releases in Taskfile * feat: add GitHub Actions workflow for release automation * feat: add linter workflow and configuration files * feat: add initial GoReleaser configuration for project builds and releases * feat: update installation instructions in README.md for clarity and additional options * chore: fix linter errors * doc: add badges for GitHub release, downloads, coverage, and license in README.md * chore: update golangci-lint version to v2.4.0 in linter workflow * chore: update golangci-lint binaries location to v2.4.0 in linter workflow
1 parent 5d6666c commit 510a245

31 files changed

+6034
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [sgaunet]

.github/workflows/coverage.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Generate coverage badges
2+
on:
3+
push:
4+
branches: [main]
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
generate-badges:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
15+
# setup go environment
16+
- name: Set up Go
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: 1.24.x
20+
21+
- name: coverage
22+
id: coverage
23+
run: |
24+
go mod download
25+
go test ./... -coverprofile=profile.cov
26+
#echo -n "Total Coverage{{":"}} "
27+
total=$(go tool cover -func profile.cov | grep '^total:' | awk '{print $3}' | sed 's/%//')
28+
rm -f profile.cov
29+
echo "COVERAGE_VALUE=${total}" >> $GITHUB_ENV
30+
31+
- uses: actions/checkout@v5
32+
with:
33+
repository: sgaunet/gh-action-badge
34+
path: gh-action-badge
35+
ref: main
36+
fetch-depth: 1
37+
38+
- name: Generate coverage badge
39+
id: coverage-badge
40+
uses: ./gh-action-badge/.github/actions/gh-action-coverage
41+
with:
42+
limit-coverage: "30"
43+
badge-label: "coverage"
44+
badge-filename: "coverage-badge.svg"
45+
badge-value: "${COVERAGE_VALUE}"
46+
47+
- name: Print url of badge
48+
run: |
49+
echo "Badge URL: ${{ steps.coverage-badge.outputs.badge-url }}"

.github/workflows/linter.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
linter:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v5
14+
- uses: actions/setup-go@v5
15+
with:
16+
go-version: stable
17+
- name: Install task
18+
uses: jaxxstorm/action-install-gh-release@v1.12.0
19+
with:
20+
repo: go-task/task
21+
cache: enable
22+
# tag:
23+
- name: Install golangci-lint
24+
uses: jaxxstorm/action-install-gh-release@v1.12.0
25+
with:
26+
repo: golangci/golangci-lint
27+
tag: v2.4.0
28+
cache: enable
29+
binaries-location: golangci-lint-2.4.0-linux-amd64
30+
31+
- name: Run linter
32+
shell: /usr/bin/bash {0}
33+
run: |
34+
task linter

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: release
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '**' # Push events to every tag including hierarchical tags like v1.0/beta
8+
9+
permissions:
10+
contents: write
11+
packages: write
12+
13+
jobs:
14+
goreleaser-release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
-
18+
name: Checkout
19+
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 0
22+
- name: Install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '>=1.24'
26+
- name: Install task
27+
uses: jaxxstorm/action-install-gh-release@v1.12.0
28+
with:
29+
repo: go-task/task
30+
# tag:
31+
- name: Install goreleaser
32+
uses: jaxxstorm/action-install-gh-release@v1.12.0
33+
with:
34+
repo: goreleaser/goreleaser
35+
# tag:
36+
37+
-
38+
# Add support for more platforms with QEMU (optional)
39+
# https://github.com/docker/setup-qemu-action
40+
name: Set up QEMU
41+
uses: docker/setup-qemu-action@v3
42+
-
43+
name: Set up Docker Buildx
44+
uses: docker/setup-buildx-action@v3
45+
46+
- name: Login to GitHub Container Registry
47+
uses: docker/login-action@v3
48+
with:
49+
registry: ghcr.io
50+
username: ${{ github.actor }}
51+
password: ${{ secrets.GITHUB_TOKEN }}
52+
53+
- name: Create release
54+
shell: /usr/bin/bash {0}
55+
run: |
56+
task release
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
60+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
61+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

.github/workflows/snapshot.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: snapshot
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
goreleaser-snapshot:
11+
runs-on: ubuntu-latest
12+
steps:
13+
-
14+
name: Checkout
15+
uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- name: Install Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: '>=1.24'
22+
- name: Install task
23+
uses: jaxxstorm/action-install-gh-release@v1.12.0
24+
with:
25+
repo: go-task/task
26+
cache: true
27+
# tag:
28+
- name: Install goreleaser
29+
uses: jaxxstorm/action-install-gh-release@v1.12.0
30+
with:
31+
repo: goreleaser/goreleaser
32+
cache: true
33+
# tag:
34+
35+
-
36+
# Add support for more platforms with QEMU (optional)
37+
# https://github.com/docker/setup-qemu-action
38+
name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
-
41+
name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Login to GitHub Container Registry
45+
uses: docker/login-action@v3
46+
with:
47+
registry: ghcr.io
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Create snapshot release
52+
shell: /usr/bin/bash {0}
53+
run: |
54+
task snapshot
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
58+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Tests
2+
on:
3+
push:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- name: Install Go
14+
uses: actions/setup-go@v5
15+
with:
16+
go-version: '>=1.24'
17+
18+
-
19+
# Add support for more platforms with QEMU (optional)
20+
# https://github.com/docker/setup-qemu-action
21+
name: Set up QEMU
22+
uses: docker/setup-qemu-action@v3
23+
-
24+
name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Download dependencies
28+
run: go mod download
29+
30+
- name: Verify dependencies
31+
run: go mod verify
32+
33+
- name: Run unit tests
34+
run: |
35+
go test -v -race ./...
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Vulnerability Scan
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
schedule:
9+
- cron: '0 2 1 * *' # Run at 2 AM on the 1st of every month
10+
workflow_dispatch: # Allow manual triggering
11+
12+
permissions:
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
vulnerability-scan:
18+
runs-on: ubuntu-latest
19+
name: Run govulncheck
20+
steps:
21+
- name: Check out code
22+
uses: actions/checkout@v5
23+
24+
- name: Set up Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: 'go.mod'
28+
29+
- name: Run govulncheck
30+
uses: golang/govulncheck-action@v1
31+
with:
32+
go-package: ./...

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# Go workspace file
18+
go.work
19+
20+
# Built executable
21+
postgresql-mcp
22+
23+
# OS generated files
24+
.DS_Store
25+
.DS_Store?
26+
._*
27+
.Spotlight-V100
28+
.Trashes
29+
ehthumbs.db
30+
Thumbs.db
31+
32+
# IDE files
33+
.idea/
34+
*.swp
35+
*.swo
36+
*~
37+
38+
# Logs
39+
*.log
40+
41+
# Environment files
42+
.env
43+
.env.local
44+
.env.*.local
45+
46+
# Database files (if any test databases are created)
47+
*.db
48+
*.sqlite
49+
50+
# Temporary files
51+
tmp/
52+
temp/

.golangci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
version: "2"
3+
# Configure which files to skip during linting
4+
run:
5+
tests: false
6+
7+
linters:
8+
default: all
9+
10+
disable:
11+
- wsl
12+
- wsl_v5
13+
- nlreturn
14+
- depguard
15+
- gochecknoinits
16+
- gochecknoglobals
17+
- forbidigo
18+
- varnamelen
19+
- exhaustruct
20+
- tagliatelle
21+
- noinlineerr
22+
- revive
23+
- ireturn
24+
- misspell

0 commit comments

Comments
 (0)