{"id":30203030,"url":"https://github.com/vimkim/cubrid-logtopbind-rs","last_synced_at":"2025-08-13T11:14:27.592Z","repository":{"id":274313707,"uuid":"922542923","full_name":"vimkim/cubrid-logtopbind-rs","owner":"vimkim","description":"CLI Utility that rebinds CUBRID Broker Logs","archived":false,"fork":false,"pushed_at":"2025-02-03T04:11:03.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T05:20:03.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vimkim.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}},"created_at":"2025-01-26T13:54:30.000Z","updated_at":"2025-02-03T04:11:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"eeb8c55b-dd86-4fbc-97dd-a2f12fea7bf0","html_url":"https://github.com/vimkim/cubrid-logtopbind-rs","commit_stats":null,"previous_names":["vimkim/cubrid-logtopbind-rs"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/vimkim/cubrid-logtopbind-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimkim%2Fcubrid-logtopbind-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimkim%2Fcubrid-logtopbind-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimkim%2Fcubrid-logtopbind-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimkim%2Fcubrid-logtopbind-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vimkim","download_url":"https://codeload.github.com/vimkim/cubrid-logtopbind-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vimkim%2Fcubrid-logtopbind-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270228697,"owners_count":24548888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"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":[],"created_at":"2025-08-13T11:13:58.933Z","updated_at":"2025-08-13T11:14:27.525Z","avatar_url":"https://github.com/vimkim.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUBRID Log Analysis Tool : logtopbind-rs\n\nA high-performance tool for analyzing CUBRID broker logs, converting them into human-readable format and storing them in SQLite for easy querying and analysis.\n\n![image](https://github.com/user-attachments/assets/0b7486b5-60c1-47f5-ac4e-638b8c0b7da2)\n\n\n## Overview\n\nThis tool helps CUBRID engineers and users inspect and analyze broker logs by:\n\n- Converting raw CUBRID broker log files into a SQLite database\n- Rebinding variables into their original SQL queries\n- Formatting SQL queries for better readability\n- Providing an interactive SQL interface for log analysis\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone [your-repository-url]\ncd cubrid-logtopbind-rs\n```\n\n2. Build the project:\n\n```bash\ncargo build --release\n```\n\nOr using Just:\n\n```bash\njust release\n```\n\n## Usage\n\n### Basic Usage\n\nConvert a broker log file to SQLite database:\n\n```bash\n./target/release/logtopbind path/to/your/broker.log\n```\n\nThis will create a `queries.db` file in your current directory.\n\n![image](https://github.com/user-attachments/assets/44e3db0f-6c79-4c17-9cd3-5e6e7108e2a0)\n\n\u003e It only takes a few seconds to create queries.db, even for 50M log_top.q file input.\n\n### Query Inspection Utility\n\nThe `logtopprint` utility allows you to quickly inspect specific queries by their query number:\n\n```bash\ncargo build --bin logtopprint\n./target/debug/logtopprint --query-no \u003cQUERY_NO\u003e\n```\n\nAvailable options:\n\n```\nOptions:\n  -q, --query-no \u003cQUERY_NO\u003e  Query number to look up\n  -d, --database \u003cDATABASE\u003e  Path to the SQLite database file [default: queries.db]\n  -h, --help                 Print help\n  -V, --version              Print version\n```\n\nExample usage:\n\n```bash\n./target/debug/logtopprint --query-no 3\n```\n\n### Interactive SQL Query Mode\n\n![image](https://github.com/user-attachments/assets/cdf585dc-788f-4cb9-b415-68b87f8bb76a)\n\nTo analyze the converted logs using SQL:\n\n```bash\n./target/release/sqlite-rs queries.db\n```\n\nOr run specific queries:\n\n```bash\n./target/release/sqlite-rs queries.db 'SELECT * FROM logs;'\n```\n\n### Database Schema\n\nThe tool creates a SQLite database with the following schema:\n\n```sql\nCREATE TABLE IF NOT EXISTS logs (\n    id INTEGER PRIMARY KEY AUTOINCREMENT,\n    query_no TEXT NOT NULL,\n    filename TEXT NOT NULL,\n    original_query TEXT NOT NULL,\n    replaced_query TEXT,\n    bind_vars JSON NOT NULL\n);\n```\n\n### Common Query Examples\n\n1. View all queries with their bound variables:\n\n```sql\nSELECT query_no, replaced_query FROM logs;\n```\n\n2. Get the first bind variable from each query:\n\n```sql\nSELECT bind_vars -\u003e '$[0]' FROM logs;\n```\n\n## Development\n\n### Prerequisites\n\n- Rust (latest stable version)\n- SQLite 3 (optional)\n- Just command runner (optional)\n\n### Available Commands\n\nThe project uses Just as a command runner. Here are some useful commands:\n\n```bash\n# Build the project\njust build\n# Run tests\njust test\n# Format code\njust format\n# Lint code\njust lint\n# Run with test data\njust run-logtopbind-simple\n# Run with larger dataset (500k entries)\njust run-logtopbind-500k\n```\n\n### Performance Testing\n\nThe tool includes performance test targets:\n\n```bash\n# Test with small dataset\njust run-logtopbind-simple\n# Test with large dataset (500k entries)\njust run-logtopbind-500k\n```\n\n### Dependencies\n\n- `anyhow`: Error handling\n- `indicatif`: Progress bars\n- `regex`: Regular expression parsing\n- `rusqlite`: SQLite database interface\n- `serde_json`: JSON processing\n- `sqlformat`: SQL formatting\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimkim%2Fcubrid-logtopbind-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvimkim%2Fcubrid-logtopbind-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvimkim%2Fcubrid-logtopbind-rs/lists"}