{"id":22908909,"url":"https://github.com/nrempel/sleek","last_synced_at":"2025-05-16T07:05:38.458Z","repository":{"id":151888169,"uuid":"625010087","full_name":"nrempel/sleek","owner":"nrempel","description":"Sleek is a CLI tool for formatting SQL. It helps you maintain a consistent style across your SQL code, enhancing readability and productivity.","archived":false,"fork":false,"pushed_at":"2024-07-15T05:03:39.000Z","size":57,"stargazers_count":214,"open_issues_count":24,"forks_count":20,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T01:38:14.807Z","etag":null,"topics":["cli","command-line","command-line-tool","formatter","sql"],"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/nrempel.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":"2023-04-07T20:33:06.000Z","updated_at":"2025-05-06T12:03:48.000Z","dependencies_parsed_at":"2023-12-28T18:28:57.659Z","dependency_job_id":"39f9aa97-5b7c-4d79-ab95-59ba46048c10","html_url":"https://github.com/nrempel/sleek","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrempel%2Fsleek","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrempel%2Fsleek/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrempel%2Fsleek/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nrempel%2Fsleek/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nrempel","download_url":"https://codeload.github.com/nrempel/sleek/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485062,"owners_count":22078767,"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","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":["cli","command-line","command-line-tool","formatter","sql"],"created_at":"2024-12-14T03:33:13.369Z","updated_at":"2025-05-16T07:05:33.448Z","avatar_url":"https://github.com/nrempel.png","language":"Rust","funding_links":[],"categories":["Programming Languages"],"sub_categories":[],"readme":"# Sleek ✨\n\n[![Crates.io](https://img.shields.io/crates/v/sleek.svg)](https://crates.io/crates/sleek)\n[![GitHub Actions](https://github.com/nrempel/sleek/actions/workflows/rust.yml/badge.svg)](https://github.com/nrempel/sleek/actions)\n[![GitHub Releases](https://img.shields.io/github/release/nrempel/sleek.svg)](https://github.com/nrempel/sleek/releases)\n\nSleek is a CLI tool for formatting SQL. It helps you maintain a consistent style\nacross your SQL code, enhancing readability and productivity.\n\nThe heavy lifting is done by the\n[sqlformat](https://github.com/shssoichiro/sqlformat-rs) crate.\n\n## Before and After\n\nHere's an example of a SQL query before and after being formatted by Sleek:\n\n### Before\n\n```sql\nselect id, name, email from users where id in (select user_id from orders where total \u003e 100) and status = 'active'\n```\n\n### After\n\n```sql\nSELECT\n    id,\n    name,\n    email\nFROM\n    users\nWHERE\n    id IN (\n        SELECT\n            user_id\n        FROM\n            orders\n        WHERE\n            total \u003e 100\n    )\n    AND STATUS = 'active'\n```\n\n## Features\n\n- Format SQL files using customizable indentation and character case options\n- Supports glob patterns, allowing you to format multiple files and patterns\n- Check whether your SQL files are already formatted without altering them with\n  the `--check` flag\n\n## Installation\n\n### Download Compiled Binaries\n\nYou can download the compiled binaries for Sleek from the\n[GitHub Releases](https://github.com/nrempel/sleek/releases) page. Choose the\nbinary that corresponds to your operating system and architecture, and place it\nin a directory included in your system's `PATH` environment variable.\n\n### Install with Cargo\n\nTo install Sleek using Cargo, you'll need to have\n[Rust](https://www.rust-lang.org/tools/install) installed on your system. Once\nRust is installed, you can install Sleek with Cargo:\n\n```bash\ncargo install sleek\n```\n\n## Usage\n\n```bash\nsleek [FLAGS] [OPTIONS] \u003cfile_paths\u003e...\n```\n\n### Arguments\n\n- `\u003cfile_paths\u003e...`: File path(s) to format, supports glob patterns. If no file\n  paths are provided, reads from stdin.\n\n### Flags\n\n- `-c`, `--check`: Check if the code is already formatted. If not, it will exit\n  with an error message.\n- `-h`, `--help`: Prints help information.\n- `-V`, `--version`: Prints version information.\n\n### Options\n\n- `-i`, `--indent_spaces \u003cindent_spaces\u003e`: Set the number of spaces to use for\n  indentation (default: 4).\n- `-U`, `--uppercase \u003cuppercase\u003e`: Change reserved keywords to ALL CAPS\n  (default: true).\n- `-l`, `--lines_between_queries \u003clines_between_queries\u003e`: Set the number of\n  line breaks after a query (default: 2).\n\n## Examples\n\nFormat a query from stdin:\n\n```bash\n\u003e echo \"select * from users\" | sleek --uppercase\nSELECT\n    *\nFROM\n    user\n```\n\nTo check if a query is formatted correctly from stdin:\n\n```bash\n\u003e echo \"select * from users\" | sleek --check\nInput is not formatted correctly. Run without --check to format the input.\n```\n\nTo format a single file with the default options:\n\n```bash\nsleek my_query.sql\n```\n\nTo format multiple files using a glob pattern:\n\n```bash\nsleek \"queries/*.sql\"\n```\n\nTo format files with custom options:\n\n```bash\nsleek --indent_spaces 2 --uppercase false \"queries/*.sql\"\n```\n\nTo check if files are already formatted:\n\n```bash\nsleek --check \"queries/*.sql\"\n```\n\n## License\n\nThis project is available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrempel%2Fsleek","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnrempel%2Fsleek","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnrempel%2Fsleek/lists"}