Added more examples and pgsql reader
Some checks are pending
CI / Build (push) Waiting to run
CI / Test (1.23) (push) Waiting to run
CI / Test (1.24) (push) Waiting to run
CI / Test (1.25) (push) Waiting to run
CI / Lint (push) Waiting to run

This commit is contained in:
2025-12-17 10:08:50 +02:00
parent 5d60bc3b2c
commit db6cd21511
22 changed files with 6741 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: all build test lint coverage clean install help
.PHONY: all build test lint coverage clean install help docker-up docker-down docker-test docker-test-integration
# Binary name
BINARY_NAME=relspec
@@ -58,5 +58,36 @@ deps: ## Download dependencies
$(GOMOD) tidy
@echo "Dependencies updated"
docker-up: ## Start PostgreSQL test database
@echo "Starting PostgreSQL test database..."
@if command -v docker-compose > /dev/null 2>&1; then \
docker-compose up -d postgres; \
else \
docker compose up -d postgres; \
fi
@echo "Waiting for PostgreSQL to be ready..."
@sleep 3
@echo "PostgreSQL is running on port 5433"
@echo "Connection: postgres://relspec:relspec_test_password@localhost:5433/relspec_test"
docker-down: ## Stop PostgreSQL test database
@echo "Stopping PostgreSQL test database..."
@if command -v docker-compose > /dev/null 2>&1; then \
docker-compose down; \
else \
docker compose down; \
fi
@echo "PostgreSQL stopped"
docker-test: ## Run PostgreSQL integration tests with Docker
@./tests/postgres/run_tests.sh
docker-test-integration: docker-up ## Start DB and run integration tests
@echo "Running integration tests..."
@sleep 2
@RELSPEC_TEST_PG_CONN="postgres://relspec:relspec_test_password@localhost:5433/relspec_test" \
$(GOTEST) -v ./pkg/readers/pgsql/ -count=1 || (make docker-down && exit 1)
@make docker-down
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'