{"id":31260625,"url":"https://github.com/b4s36t4/db-client","last_synced_at":"2026-05-14T12:36:17.996Z","repository":{"id":312858184,"uuid":"1049018284","full_name":"b4s36t4/db-client","owner":"b4s36t4","description":"Vibe coded TUI DB client, supports sqlite, postgres and mysql","archived":false,"fork":false,"pushed_at":"2025-09-02T11:29:33.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-23T09:35:02.933Z","etag":null,"topics":["client","db","dbclient","devtools","mysql-client","postgresql-client","rust","sqlite-client","tui"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/b4s36t4.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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-02T11:17:04.000Z","updated_at":"2025-09-02T11:29:37.000Z","dependencies_parsed_at":"2025-09-02T13:28:13.372Z","dependency_job_id":"9a4548ff-0783-4c40-97e3-2449bcea3d31","html_url":"https://github.com/b4s36t4/db-client","commit_stats":null,"previous_names":["b4s36t4/db-client"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/b4s36t4/db-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4s36t4%2Fdb-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4s36t4%2Fdb-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4s36t4%2Fdb-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4s36t4%2Fdb-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b4s36t4","download_url":"https://codeload.github.com/b4s36t4/db-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b4s36t4%2Fdb-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33025346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["client","db","dbclient","devtools","mysql-client","postgresql-client","rust","sqlite-client","tui"],"created_at":"2025-09-23T09:27:46.956Z","updated_at":"2026-05-14T12:36:17.652Z","avatar_url":"https://github.com/b4s36t4.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rata-DB - Terminal Database Client\n\nA modern, developer-friendly TUI (Terminal User Interface) database client built with Rust, supporting MySQL, PostgreSQL, and SQLite databases.\n\n## Features\n\n- **Multi-Database Support**: Connect to MySQL, PostgreSQL, and SQLite databases\n- **Beautiful TUI Interface**: Clean, modern terminal interface built with Ratatui\n- **Interactive Navigation**: Keyboard-driven navigation with visual feedback\n- **Connection Management**: Save and manage multiple database connections\n- **Table Browser**: Browse tables, view schemas, and column information\n- **SQL Query Editor**: Write and execute SQL queries with cursor position tracking\n- **Results Viewer**: View query results in a tabular format with scrolling support\n- **Error Handling**: Comprehensive error messages and status updates\n- **Demo Database**: Built-in demo SQLite database with sample data\n\n## Installation\n\n### Prerequisites\n\n- Rust (1.70 or later)\n- Cargo\n\n### Build from Source\n\n```bash\ngit clone \u003crepository-url\u003e\ncd rata-db\ncargo build --release\n```\n\nThe binary will be available at `target/release/rata-db`\n\n## Usage\n\n### Starting the Application\n\n```bash\n# Run the application\n./target/release/rata-db\n\n# Or during development\ncargo run\n```\n\n### Creating Demo Database\n\nTo create a demo SQLite database with sample data:\n\n```bash\n./target/release/rata-db --create-demo\n# Or during development\ncargo run -- --create-demo\n```\n\nThis creates a `demo.db` file with sample tables (`users`, `orders`, `categories`) and data.\n\n## Interface Guide\n\n### Connection Management\n\n- **Navigation**: Use ↑/↓ arrow keys to navigate connections\n- **Connect**: Press `Enter` to connect to selected database\n- **New Connection**: Press `n` to create a new connection\n- **Delete Connection**: Press `d` to delete selected connection\n- **Connected Status**: Connected databases show a green ● indicator\n\n### Connection Form\n\n- **Field Navigation**: Use `Tab` to switch between name and connection string fields\n- **Cursor Visualization**: Active field shows cursor position with `|`\n- **Save**: Press `Enter` to save the connection\n- **Cancel**: Press `Esc` to cancel\n\n#### Connection String Examples\n\n```\n# SQLite\nsqlite:database.db\nsqlite::memory:\n\n# PostgreSQL\npostgresql://user:password@localhost/database_name\n\n# MySQL\nmysql://user:password@localhost/database_name\n```\n\n### Table Browser\n\n- **Navigation**: Use ↑/↓ to navigate between tables\n- **Column View**: Selected table's columns are shown on the right\n- **Quick SELECT**: Press `s` to generate a SELECT query for the current table\n- **Query Editor**: Press `q` to open the query editor\n- **Refresh**: Press `r` to refresh the table list\n\n### Query Editor\n\n- **Cursor Tracking**: Shows cursor position in the title bar\n- **Visual Cursor**: Block cursor (█) shows current position in query text\n- **Execute**: Press `Ctrl+Enter` to execute the query\n- **Clear**: Press `Ctrl+C` to clear the query\n- **Navigation**: Use arrow keys, Home, End for cursor movement\n- **Multi-line**: Press `Enter` for new lines, `Tab` for indentation\n\n### Query Results\n\n- **Scrolling**: Use arrow keys to scroll through results\n- **Pagination**: Use `Page Up`/`Page Down` for faster scrolling\n- **Column Navigation**: Use ←/→ to scroll horizontally through columns\n- **Home**: Press `Home` to go to top-left of results\n\n### Global Shortcuts\n\n- **Help**: Press `h` or `F1` to toggle help popup\n- **Quit**: Press `q` in connection list or `Ctrl+Q` anywhere\n- **Back/Cancel**: Press `Esc` to go back or cancel current action\n- **Error Dismissal**: Press any key to dismiss error messages\n\n## Database Support\n\n### SQLite\n- Full support for local SQLite databases\n- In-memory databases supported\n- Schema browsing and table information\n- All standard SQL operations\n\n### PostgreSQL\n- Connection pooling with configurable connections\n- Schema-aware table browsing\n- Full PostgreSQL SQL support\n- Proper handling of schemas and namespaces\n\n### MySQL\n- Connection pooling support\n- Table and column metadata retrieval\n- Standard MySQL SQL operations\n- Proper handling of MySQL-specific features\n\n## Architecture\n\nThe application is built with a modular architecture:\n\n- **`main.rs`**: Application entry point and terminal setup\n- **`app.rs`**: Application state management and business logic\n- **`database.rs`**: Database abstraction layer with SQLx integration\n- **`ui.rs`**: User interface rendering with Ratatui widgets\n- **`event.rs`**: Keyboard event handling and navigation\n- **`demo.rs`**: Demo database creation and sample queries\n\n### Key Technologies\n\n- **[Ratatui](https://github.com/ratatui-org/ratatui)**: Terminal UI framework\n- **[SQLx](https://github.com/launchbadge/sqlx)**: Async SQL toolkit\n- **[Tokio](https://tokio.rs/)**: Async runtime\n- **[Crossterm](https://github.com/crossterm-rs/crossterm)**: Cross-platform terminal manipulation\n- **[Anyhow](https://github.com/dtolnay/anyhow)**: Error handling\n\n## Development\n\n### Running in Development\n\n```bash\n# Run with auto-reload\ncargo watch -x run\n\n# Run tests\ncargo test\n\n# Check for issues\ncargo clippy\n\n# Format code\ncargo fmt\n```\n\n### Project Structure\n\n```\nsrc/\n├── main.rs          # Entry point and terminal setup\n├── app.rs           # Application state and logic\n├── database.rs      # Database connection and queries\n├── ui.rs            # User interface components\n├── event.rs         # Event handling and navigation\n└── demo.rs          # Demo database creation\n```\n\n## Troubleshooting\n\n### Connection Issues\n\n1. **SQLite**: Ensure the database file exists and is readable\n2. **PostgreSQL/MySQL**: Verify connection string format and credentials\n3. **Network**: Check if the database server is accessible\n\n### Performance\n\n- Large result sets are automatically limited for display\n- Connection pooling optimizes database performance\n- Async operations prevent UI blocking\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues, feature requests, or pull requests.\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%2Fb4s36t4%2Fdb-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb4s36t4%2Fdb-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb4s36t4%2Fdb-client/lists"}