Skip to content

Commit 33100c8

Browse files
committed
feat: make this repo more open-source friendly
1 parent 642d463 commit 33100c8

14 files changed

Lines changed: 1287 additions & 78 deletions

.env.example

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Database Handler CLI - Environment Configuration
2+
#
3+
# This file shows how to configure database connections for the CLI.
4+
# Copy this file to `.env` and fill in your actual database credentials.
5+
#
6+
# IMPORTANT: Never commit the `.env` file to version control!
7+
8+
# ============================================================================
9+
# Database Connections
10+
# ============================================================================
11+
#
12+
# Format: DATABASE_URL=postgresql://user:password@host:port/database
13+
#
14+
# Add a comment above each DATABASE_URL to give it a friendly name.
15+
# This name will appear in the interactive database selection menu.
16+
#
17+
# You can define multiple database connections below.
18+
19+
# Production Database
20+
DATABASE_URL=postgresql://user:password@localhost:5432/prod_db
21+
22+
# Staging Database
23+
DATABASE_URL=postgresql://user:password@localhost:5432/staging_db
24+
25+
# Development Database
26+
DATABASE_URL=postgresql://user:password@localhost:5432/dev_db
27+
28+
# Local Test Database
29+
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/test_db
30+
31+
32+
# If you don't want to add comments in your `.env` file,
33+
# you can simply give a much more explicit name to your DATABASE_URL like :
34+
35+
DATABASE_URL_DEV=postgresql://user:password@localhost:5432/dev_db
36+
37+
DATABASE_URL_PROD=postgresql://user:password@localhost:5432/prod_db
38+
39+
DATABASE_URL_DEMO=postgresql://user:password@localhost:5432/demo_db
40+
41+
# ============================================================================
42+
# SSL Configuration (Optional)
43+
# ============================================================================
44+
#
45+
# For databases requiring SSL, add one of the following to your connection string:
46+
# - ?sslmode=require
47+
# - ?ssl=true
48+
#
49+
# Example:
50+
# DATABASE_URL=postgresql://user:password@host:5432/db?sslmode=require
51+
52+
# ============================================================================
53+
# Cloud Provider Examples
54+
# ============================================================================
55+
56+
# AWS RDS
57+
# DATABASE_URL=postgresql://user:password@mydb.abc123.us-east-1.rds.amazonaws.com:5432/mydb
58+
59+
# Heroku Postgres
60+
# DATABASE_URL=postgres://user:password@ec2-xx-xxx-xx-xxx.compute-1.amazonaws.com:5432/dbname
61+
62+
# Supabase
63+
# DATABASE_URL=postgresql://postgres:password@db.xxxxx.supabase.co:5432/postgres
64+
65+
# Railway
66+
# DATABASE_URL=postgresql://postgres:password@containers-us-west-xx.railway.app:5432/railway
67+
68+
# Render
69+
# DATABASE_URL=postgresql://user:password@xxx-postgres.render.com/dbname
70+
71+
# ============================================================================
72+
# Notes
73+
# ============================================================================
74+
#
75+
# - Make sure your database user has appropriate permissions:
76+
# - SELECT (for dumps and listing)
77+
# - INSERT (for imports)
78+
# - DELETE (for truncate)
79+
# - DROP (for drop operations)
80+
#
81+
# - For production databases, consider using read-only credentials
82+
# for dump operations to prevent accidental data modification.
83+
#
84+
# - Always test with a non-production database first!
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Steps to Reproduce
14+
15+
1. Run command `database-handler`
16+
2. Select '...'
17+
3. Observe error '...'
18+
19+
## Expected Behavior
20+
21+
What you expected to happen.
22+
23+
## Actual Behavior
24+
25+
What actually happened.
26+
27+
## Environment
28+
29+
- **OS**: [e.g., macOS 14.0, Ubuntu 22.04, Windows 11]
30+
- **Node.js version**: [e.g., 20.10.0] (run `node --version`)
31+
- **CLI version**: [e.g., 1.1.0] (run `npm list -g database-handler-cli`)
32+
- **PostgreSQL version**: [e.g., 15.3]
33+
- **Installation method**: [npm global / local development]
34+
35+
## Error Messages
36+
37+
If applicable, paste any error messages or stack traces here:
38+
39+
```
40+
Error message here
41+
```
42+
43+
## Database Configuration
44+
45+
**Without revealing credentials**, describe your database setup:
46+
- Connection type: [local / remote / cloud]
47+
- SSL enabled: [yes / no]
48+
- Special configuration: [any non-standard setup]
49+
50+
## Additional Context
51+
52+
Add any other context about the problem here. Screenshots can be helpful for UI-related issues.
53+
54+
## Possible Solution
55+
56+
If you have ideas on what might be causing this or how to fix it, please share.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: GitHub Discussions
4+
url: https://github.com/Raumain/database-handler-cli/discussions
5+
about: Ask questions and discuss ideas with the community
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
Is your feature request related to a problem? Please describe.
16+
17+
Example: *"I'm always frustrated when I need to [...]"*
18+
19+
## Proposed Solution
20+
21+
Describe how you envision this feature working.
22+
23+
## Alternatives Considered
24+
25+
Have you thought about any alternative solutions or features?
26+
27+
## Use Case
28+
29+
Who would benefit from this feature and how?
30+
31+
- **User type**: [e.g., solo developer, team, enterprise]
32+
- **Frequency**: [e.g., daily, occasionally]
33+
- **Impact**: [e.g., saves time, improves workflow, reduces errors]
34+
35+
## Example Usage
36+
37+
If applicable, show how you'd like to use this feature:
38+
39+
```bash
40+
# Example command or workflow
41+
database-handler --new-feature
42+
```
43+
44+
## Additional Context
45+
46+
Add any other context, screenshots, or examples about the feature request here.
47+
48+
## Scope Consideration
49+
50+
Does this feature:
51+
- [ ] Fit within the current scope (PostgreSQL database management)?
52+
- [ ] Require new dependencies?
53+
- [ ] Break backward compatibility?
54+
- [ ] Need documentation updates?
55+
56+
## Willingness to Contribute
57+
58+
- [ ] I'm willing to submit a PR for this feature
59+
- [ ] I'd like help implementing this
60+
- [ ] I'm just suggesting the idea

.github/ISSUE_TEMPLATE/question.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Question
3+
about: Ask a question about usage or functionality
4+
title: '[QUESTION] '
5+
labels: question
6+
assignees: ''
7+
---
8+
9+
## Question
10+
11+
What would you like to know?
12+
13+
## Context
14+
15+
Please provide context about what you're trying to accomplish:
16+
17+
- What operation are you performing? [dump, import, drop, etc.]
18+
- What's your database setup? [local, cloud, size, complexity]
19+
- What have you already tried?
20+
21+
## Expected Information
22+
23+
What kind of answer are you looking for?
24+
25+
- [ ] How to use a specific feature
26+
- [ ] Best practices or recommendations
27+
- [ ] Clarification on behavior
28+
- [ ] Troubleshooting help
29+
- [ ] Other (please describe)
30+
31+
## Additional Context
32+
33+
Add any other relevant information, error messages, or screenshots.

.github/pull_request_template.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
## Description
2+
3+
<!-- Provide a clear and concise description of your changes -->
4+
5+
## Type of Change
6+
7+
<!-- Mark the relevant option with an "x" -->
8+
9+
- [ ] Bug fix (non-breaking change that fixes an issue)
10+
- [ ] New feature (non-breaking change that adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
- [ ] Performance improvement
14+
- [ ] Code refactoring
15+
- [ ] Test coverage improvement
16+
17+
## Related Issue
18+
19+
<!-- Link to the issue this PR addresses -->
20+
21+
Fixes #(issue number)
22+
23+
## Changes Made
24+
25+
<!-- List the specific changes you made -->
26+
27+
-
28+
-
29+
-
30+
31+
## Testing
32+
33+
<!-- Describe the tests you ran to verify your changes -->
34+
35+
- [ ] Tested with PostgreSQL version(s):
36+
- [ ] Tested on OS:
37+
- [ ] Ran `bun run fmt.check` (no errors)
38+
- [ ] Manual testing performed
39+
- [ ] All existing features still work
40+
41+
### Test Scenarios
42+
43+
<!-- Describe the specific scenarios you tested -->
44+
45+
1.
46+
2.
47+
3.
48+
49+
## Checklist
50+
51+
<!-- Mark completed items with an "x" -->
52+
53+
- [ ] My code follows the project's coding standards
54+
- [ ] I have run `bun run fmt` to format my code
55+
- [ ] I have commented complex code sections
56+
- [ ] I have updated the documentation (if needed)
57+
- [ ] My changes generate no new warnings or errors
58+
- [ ] I have tested my changes thoroughly
59+
- [ ] I have considered backward compatibility
60+
- [ ] I have updated the README (if needed)
61+
62+
## Screenshots (if applicable)
63+
64+
<!-- Add screenshots to help explain your changes -->
65+
66+
## Breaking Changes
67+
68+
<!-- If this PR introduces breaking changes, describe them here -->
69+
70+
None / Describe any breaking changes
71+
72+
## Additional Notes
73+
74+
<!-- Any additional information that reviewers should know -->

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v1
19+
with:
20+
bun-version: latest
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Run Biome check
26+
run: bun run fmt.check
27+
28+
build:
29+
name: Build
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Setup Bun
36+
uses: oven-sh/setup-bun@v1
37+
with:
38+
bun-version: latest
39+
40+
- name: Install dependencies
41+
run: bun install
42+
43+
- name: Build project
44+
run: bun run build
45+
46+
- name: Check build output
47+
run: |
48+
if [ ! -d "dist" ]; then
49+
echo "Build failed: dist directory not found"
50+
exit 1
51+
fi
52+
if [ ! -f "dist/src/cli.js" ]; then
53+
echo "Build failed: cli.js not found"
54+
exit 1
55+
fi
56+
57+
type-check:
58+
name: Type Check
59+
runs-on: ubuntu-latest
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Setup Bun
65+
uses: oven-sh/setup-bun@v1
66+
with:
67+
bun-version: latest
68+
69+
- name: Install dependencies
70+
run: bun install
71+
72+
- name: Run TypeScript compiler check
73+
run: bunx tsc --noEmit

0 commit comments

Comments
 (0)