{"id":37017268,"url":"https://github.com/takayahilton/sql-formatter","last_synced_at":"2026-01-14T01:58:56.456Z","repository":{"id":39851234,"uuid":"249871392","full_name":"takayahilton/sql-formatter","owner":"takayahilton","description":"SQL Formatter for Scala.","archived":false,"fork":false,"pushed_at":"2023-06-24T19:18:10.000Z","size":781,"stargazers_count":6,"open_issues_count":16,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-07-01T00:05:36.016Z","etag":null,"topics":["scala","scala-js","scala-native","scalajs","sql","sql-formatter"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/takayahilton.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":"2020-03-25T02:47:48.000Z","updated_at":"2023-05-31T22:42:33.000Z","dependencies_parsed_at":"2023-02-16T02:00:27.809Z","dependency_job_id":null,"html_url":"https://github.com/takayahilton/sql-formatter","commit_stats":null,"previous_names":[],"tags_count":5,"template":null,"template_full_name":null,"purl":"pkg:github/takayahilton/sql-formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takayahilton%2Fsql-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takayahilton%2Fsql-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takayahilton%2Fsql-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takayahilton%2Fsql-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takayahilton","download_url":"https://codeload.github.com/takayahilton/sql-formatter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takayahilton%2Fsql-formatter/sbom","scorecard":{"id":866311,"data":{"date":"2025-08-11","repo":{"name":"github.com/takayahilton/sql-formatter","commit":"57e387db7fe8d89305809f85992a4915fb9f1d41"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/takayahilton/sql-formatter/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/takayahilton/sql-formatter/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/takayahilton/sql-formatter/ci.yml/master?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/ci.yml:51","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":9,"reason":"Found 11/12 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-24T02:45:43.748Z","repository_id":39851234,"created_at":"2025-08-24T02:45:43.748Z","updated_at":"2025-08-24T02:45:43.748Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408706,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"ssl_error","status_checked_at":"2026-01-14T01:40:32.775Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["scala","scala-js","scala-native","scalajs","sql","sql-formatter"],"created_at":"2026-01-14T01:58:55.838Z","updated_at":"2026-01-14T01:58:56.441Z","avatar_url":"https://github.com/takayahilton.png","language":"Scala","readme":"# sql-formatter\n\n[![Build Status](https://travis-ci.org/takayahilton/sql-formatter.png?branch=master)](https://travis-ci.org/takayahilton/sql-formatter)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.takayahilton/sql-formatter_2.12.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.takayahilton%22%20AND%20a:%22sql-formatter_2.12%22)\n[![codecov.io](http://codecov.io/github/takayahilton/sql-formatter/coverage.svg?branch=master)](https://codecov.io/gh/takayahilton/sql-formatter/branch/master)\n[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-0.6.29.svg)](#scalajs)\n[![Scala.js](https://www.scala-js.org/assets/badges/scalajs-1.2.0.svg)](#scalajs)\n\nScala port of great SQL formatter \u003chttps://github.com/zeroturnaround/sql-formatter\u003e, \u003chttps://github.com/vertical-blank/sql-formatter\u003e.\n\nWritten with only Scala Standard Library, without dependencies.\n\n[Demo](https://takayahilton.github.io/sql-formatter/)\n\n## Usage\n\n### Scala (on JVM)\n\n```sbt\nlibraryDependencies += \"com.github.takayahilton\" %% \"sql-formatter\" % \"1.2.1\"\n```\n\n### Scala.js\n\n```sbt\nlibraryDependencies += \"com.github.takayahilton\" %%% \"sql-formatter\" % \"1.2.1\"\n```\n\n\n### Scala Native\n\n```sbt\nlibraryDependencies += \"com.github.takayahilton\" %%% \"sql-formatter\" % \"1.2.1\"\n```\n\n### Examples\n\nYou can easily use `com.github.takayahilton.sqlformatter.SqlFormatter` :\n\n```scala\nimport com.github.takayahilton.sqlformatter._\n\nSqlFormatter.format(\"SELECT * FROM table1\")\n```\n\nThis will output:\n\n```sql\nSELECT\n  *\nFROM\n  table1\n```\n\n### Dialect\n\nYou can pass dialect name to SqlFormatter.of :\n\n```scala\nimport com.github.takayahilton.sqlformatter._\n\nSqlFormatter.of(SqlDialect.CouchbaseN1QL).format(\"SELECT *\")\n```\n\nCurrently just four SQL dialects are supported:\n\n- StandardSQL - [Standard SQL](https://en.wikipedia.org/wiki/SQL:2011)\n- CouchbaseN1QL - [Couchbase N1QL](http://www.couchbase.com/n1ql)\n- DB2 - [IBM DB2](https://www.ibm.com/analytics/us/en/technology/db2/)\n- PLSQL - [Oracle PL/SQL](http://www.oracle.com/technetwork/database/features/plsql/index.html)\n\n### Format\n\nDefaults to two spaces.\nYou can pass indent string to `format` :\n\n```scala\nimport com.github.takayahilton.sqlformatter._\n\nSqlFormatter.format(\n  \"SELECT * FROM table1\",\n  indent = \"    \")\n```\n\nThis will output:\n\n```sql\nSELECT\n    *\nFROM\n    table1\n```\n\n### Placeholders replacement\n\nYou can pass `Seq` or `Map` to `format` :\n\n```scala\nimport com.github.takayahilton.sqlformatter._\n\n// Named placeholders\nSqlFormatter.format(\"SELECT * FROM tbl WHERE foo = @foo\", params = Map(\"foo\" -\u003e \"'bar'\"))\n\n// Indexed placeholders\nSqlFormatter.format(\"SELECT * FROM tbl WHERE foo = ?\", params = Seq(\"'bar'\"))\n```\n\nBoth result in:\n\n```sql\nSELECT\n  *\nFROM\n  tbl\nWHERE\n  foo = 'bar'\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakayahilton%2Fsql-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakayahilton%2Fsql-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakayahilton%2Fsql-formatter/lists"}