{"id":13817538,"url":"https://github.com/jackc/sqlfmt","last_synced_at":"2025-05-15T20:32:33.659Z","repository":{"id":33726865,"uuid":"37381118","full_name":"jackc/sqlfmt","owner":"jackc","description":"SQL Formatter","archived":true,"fork":false,"pushed_at":"2019-12-21T21:12:51.000Z","size":1625,"stargazers_count":339,"open_issues_count":4,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-19T15:45:20.112Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Yacc","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/jackc.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}},"created_at":"2015-06-13T17:31:09.000Z","updated_at":"2024-11-06T23:32:27.000Z","dependencies_parsed_at":"2022-07-29T19:19:20.035Z","dependency_job_id":null,"html_url":"https://github.com/jackc/sqlfmt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fsqlfmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fsqlfmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fsqlfmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackc%2Fsqlfmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackc","download_url":"https://codeload.github.com/jackc/sqlfmt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254418664,"owners_count":22068124,"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":[],"created_at":"2024-08-04T06:00:48.906Z","updated_at":"2025-05-15T20:32:32.987Z","avatar_url":"https://github.com/jackc.png","language":"Yacc","funding_links":[],"categories":["Misc","Yacc"],"sub_categories":[],"readme":"# sqlfmt\n\n## Installation\n\n```sh\n$ go get github.com/jackc/sqlfmt/...\n$ which sqlfmt\n$GOPATH/bin/sqlfmt\n```\n\n## Usage\n\n  - You can either:\n\n    + Provide the path to one or more SQL files as command line arguments:\n\n      ```sh\n      $ sqlfmt testdata/select_where.input.sql\n      select\n        foo,\n        bar\n      from\n        baz\n      where\n        foo \u003e 5\n        and bar \u003c 2\n      ```\n\n    + Or, directly provide the SQL string via stdin:\n\n      ```sh\n      $ echo \"select * from users\" | sqlfmt\n      select\n        *\n      from\n        users\n      ```\n\n      ```sh\n      $ sqlfmt \u003c testdata/like.input.sql\n      select\n        foo,\n        bar\n      from\n        baz\n      where\n        foo like 'abd%'\n        or foo like 'ada%' escape '!'\n        or foo not like 'abd%'\n        or foo not like 'ada%' escape '!'\n        or foo ilike 'efg%'\n        or foo ilike 'ada%' escape '!'\n        or foo not ilike 'efg%'\n        or foo not ilike 'ada%' escape '!'\n      ```\n\n  - View [testdata](./testdata) for more examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fsqlfmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackc%2Fsqlfmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackc%2Fsqlfmt/lists"}