{"id":28190150,"url":"https://github.com/lamngockhuong/db","last_synced_at":"2026-05-01T00:31:56.316Z","repository":{"id":293086151,"uuid":"982224858","full_name":"lamngockhuong/db","owner":"lamngockhuong","description":"Database Testing","archived":false,"fork":false,"pushed_at":"2025-05-13T15:53:21.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T06:40:47.985Z","etag":null,"topics":["database","mysql","performance","postgresql","testing"],"latest_commit_sha":null,"homepage":"http://me.ngockhuong.com/db/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lamngockhuong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-12T14:57:27.000Z","updated_at":"2025-05-13T15:53:24.000Z","dependencies_parsed_at":"2025-06-29T03:33:21.090Z","dependency_job_id":null,"html_url":"https://github.com/lamngockhuong/db","commit_stats":null,"previous_names":["lamngockhuong/db"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lamngockhuong/db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamngockhuong%2Fdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamngockhuong%2Fdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamngockhuong%2Fdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamngockhuong%2Fdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamngockhuong","download_url":"https://codeload.github.com/lamngockhuong/db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamngockhuong%2Fdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32481553,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","mysql","performance","postgresql","testing"],"created_at":"2025-05-16T10:12:08.584Z","updated_at":"2026-05-01T00:31:56.275Z","avatar_url":"https://github.com/lamngockhuong.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database Testing Repository\n\nThis repository contains test cases and scenarios for PostgreSQL and MySQL databases. It's designed to help developers test various database features, behaviors, and edge cases across different versions.\n\n## Supported Database Versions\n\n### PostgreSQL\n\n- 17 (Port: 5417)\n- 16 (Port: 5416)\n\n### MySQL\n\n- 9 (Port: 3390)\n- 8 (Port: 3380)\n\n## Repository Structure\n\n```\n.\n├── tests/                    # Test cases directory\n│   ├── postgresql/           # PostgreSQL test cases\n│   │   └── length_test/      # Tests for string length functions\n│   └── mysql/                # MySQL test cases\n│       └── length_test/      # Tests for string length functions\n├── scripts/                  # Utility scripts\n│   ├── run_containers.sh     # Container management script\n│   ├── run_sql.sh            # SQL execution script\n│   └── common.sh             # Common functions for scripts\n├── results/                  # Test results and logs\n├── docker-compose.yml        # Container configuration\n├── .gitignore                # Git ignore rules\n├── .cursorignore             # Cursor IDE ignore rules\n└── LICENSE                   # MIT License file\n```\n\n## Database Configuration\n\n### PostgreSQL\n\n- Default user: testuser\n- Default password: testpass\n- Default database: testdb\n- Data persistence: Yes (Docker volumes)\n\n### MySQL\n\n- Root password: rootpass\n- Default user: testuser\n- Default password: testpass\n- Default database: testdb\n- Data persistence: Yes (Docker volumes)\n\n## Test Categories\n\n1. **Basic Operations**\n\n   - CRUD operations\n   - Data types and constraints\n   - Indexes and performance\n   - Basic SQL queries and joins\n\n2. **Advanced Features**\n\n   - Transactions and ACID properties\n   - Concurrency and locking\n   - Partitioning and sharding\n   - Stored procedures and functions\n   - Triggers and events\n\n3. **Edge Cases**\n   - Error handling and recovery\n   - Boundary conditions\n   - Performance under load\n   - Data integrity scenarios\n   - Version-specific features\n\n## Getting Started\n\n### Prerequisites\n\n- Docker or Podman installed\n- Docker Compose or Podman Compose\n- Basic knowledge of SQL and database concepts\n\n### Running Tests\n\n1. Start the required database container:\n\n   ```bash\n   # Using Docker (default)\n   ./scripts/run_containers.sh start postgres_17_test  # For PostgreSQL 17\n   # or\n   ./scripts/run_containers.sh start mysql_9_test      # For MySQL 9\n\n   # Using Podman\n   CONTAINER_RUNTIME=podman ./scripts/run_containers.sh start postgres_17_test\n   ```\n\n2. Execute SQL test files:\n\n   ```bash\n   # Run PostgreSQL test\n   ./scripts/run_sql.sh tests/postgresql/length_test/length_test.sql postgres 17\n\n   # Run MySQL test\n   ./scripts/run_sql.sh tests/mysql/length_test/length_test.sql mysql 9\n   ```\n\n   The script will:\n\n   - Execute the SQL file in the specified database container\n   - Save the output to the results directory with timestamp\n   - Display the results in the terminal\n\n3. Check test results:\n\n   ```bash\n   # View PostgreSQL test results\n   ls -l results/postgresql/version_17/\n\n   # View MySQL test results\n   ls -l results/mysql/version_9/\n   ```\n\n   Test results are saved in the following format:\n\n   ```\n   results/\n   ├── postgresql/\n   │   └── version_17/\n   │       └── length_test_YYYYMMDD_HHMMSS.log\n   └── mysql/\n       └── version_9/\n           └── length_test_YYYYMMDD_HHMMSS.log\n   ```\n\n4. Stop containers when done:\n\n   ```bash\n   ./scripts/run_containers.sh stop postgres_17_test  # Stop PostgreSQL 17\n   # or\n   ./scripts/run_containers.sh stop mysql_9_test      # Stop MySQL 9\n   ```\n\n### Container Management\n\nThe repository includes a container management script (`scripts/run_containers.sh`) with the following commands:\n\n```bash\n./scripts/run_containers.sh help    # Show help\n./scripts/run_containers.sh start   # Start containers\n./scripts/run_containers.sh stop    # Stop containers\n./scripts/run_containers.sh status  # Show container status\n./scripts/run_containers.sh logs    # View container logs\n./scripts/run_containers.sh list    # List available containers\n```\n\n## Best Practices\n\n1. **Test Isolation**\n\n   - Each test should be independent and self-contained\n   - Clean up test data after execution\n   - Use transactions where appropriate\n   - Avoid test interdependencies\n\n2. **Documentation**\n\n   - Document test prerequisites and setup\n   - Include expected results and edge cases\n   - Note any version-specific behaviors\n   - Document performance expectations\n\n3. **Version Compatibility**\n\n   - Test across all supported versions\n   - Document version-specific features\n   - Handle version differences appropriately\n   - Maintain backward compatibility\n\n4. **Security**\n\n   - Use secure passwords in production\n   - Follow principle of least privilege\n   - Secure sensitive test data\n   - Use environment variables for credentials\n\n5. **Performance**\n   - Monitor resource usage\n   - Clean up unused containers\n   - Use appropriate indexes\n   - Optimize test queries\n\n## Contributing\n\nWhen adding new test cases:\n\n1. Create a new directory for your test category if it doesn't exist\n2. Add a README.md in your test directory explaining:\n   - Purpose of the test\n   - Expected behavior\n   - Any prerequisites or setup required\n   - Version compatibility notes\n3. Include sample data and expected results\n4. Document any version-specific behaviors\n5. Follow the established directory structure\n6. Update the main README.md if necessary\n\n## Troubleshooting\n\nCommon issues and solutions:\n\n1. **Container won't start**\n\n   - Check if ports are available\n   - Verify Docker/Podman is running\n   - Check container logs\n\n2. **Database connection issues**\n\n   - Verify container is running\n   - Check port mappings\n   - Verify credentials\n\n3. **Test failures**\n   - Check version compatibility\n   - Verify test prerequisites\n   - Review test logs\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamngockhuong%2Fdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamngockhuong%2Fdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamngockhuong%2Fdb/lists"}