{"id":13801300,"url":"https://github.com/gajus/eslint-plugin-sql","last_synced_at":"2026-01-16T03:07:28.514Z","repository":{"id":21641335,"uuid":"93494636","full_name":"gajus/eslint-plugin-sql","owner":"gajus","description":"SQL linting rules for ESLint.","archived":false,"fork":false,"pushed_at":"2026-01-12T19:59:56.000Z","size":2184,"stargazers_count":111,"open_issues_count":3,"forks_count":25,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-12T23:49:25.723Z","etag":null,"topics":["eslint","eslint-plugin","postgres","postgresql","sql"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gajus.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}},"created_at":"2017-06-06T08:28:38.000Z","updated_at":"2026-01-12T19:59:16.000Z","dependencies_parsed_at":"2023-02-18T17:31:06.194Z","dependency_job_id":"5c37a76d-a1a8-481b-a04f-3cd7ec5307bf","html_url":"https://github.com/gajus/eslint-plugin-sql","commit_stats":{"total_commits":84,"total_committers":9,"mean_commits":9.333333333333334,"dds":0.3928571428571429,"last_synced_commit":"61139248ac1aa76cb90a05106d8672bba8931ee7"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/gajus/eslint-plugin-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gajus","download_url":"https://codeload.github.com/gajus/eslint-plugin-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gajus%2Feslint-plugin-sql/sbom","scorecard":{"id":417303,"data":{"date":"2025-08-11","repo":{"name":"github.com/gajus/eslint-plugin-sql","commit":"fb3961772d8b720a0e68790020acda908905457b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"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":"Code-Review","score":0,"reason":"Found 2/28 approved changesets -- score normalized to 0","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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/feature.yaml:1","Warn: no topLevel permission defined: .github/workflows/main.yaml: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":"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/feature.yaml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/gajus/eslint-plugin-sql/feature.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/feature.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/gajus/eslint-plugin-sql/feature.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/gajus/eslint-plugin-sql/main.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/gajus/eslint-plugin-sql/main.yaml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/feature.yaml:16","Warn: npmCommand not pinned by hash: .github/workflows/main.yaml:16","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 npmCommand 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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/main.yaml:2"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 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"}},{"name":"Vulnerabilities","score":5,"reason":"5 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T00:14:58.046Z","repository_id":21641335,"created_at":"2025-08-19T00:14:58.046Z","updated_at":"2025-08-19T00:14:58.046Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28476841,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:02:43.018Z","status":"ssl_error","status_checked_at":"2026-01-16T03:01:27.857Z","response_time":107,"last_error":"SSL_read: 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":["eslint","eslint-plugin","postgres","postgresql","sql"],"created_at":"2024-08-04T00:01:21.369Z","updated_at":"2026-01-16T03:07:28.508Z","avatar_url":"https://github.com/gajus.png","language":"TypeScript","readme":"\u003ca name=\"user-content-eslint-plugin-sql\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql\"\u003e\u003c/a\u003e\n# eslint-plugin-sql\n\n[![Canonical Code Style](https://img.shields.io/badge/code%20style-canonical-blue.svg?style=flat-square)](https://github.com/gajus/canonical)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kuizinas.svg?style=social\u0026label=Follow)](https://twitter.com/kuizinas)\n\nSQL linting rules for ESLint.\n\n\u003e In its current form, the plugin has been designed and tested to work with Postgres codebase.\n\n* [eslint-plugin-sql](#user-content-eslint-plugin-sql)\n    * [Installation](#user-content-eslint-plugin-sql-installation)\n    * [Configuration](#user-content-eslint-plugin-sql-configuration)\n    * [Settings](#user-content-eslint-plugin-sql-settings)\n        * [`placeholderRule`](#user-content-eslint-plugin-sql-settings-placeholderrule)\n    * [Rules](#user-content-eslint-plugin-sql-rules)\n        * [`format`](#user-content-eslint-plugin-sql-rules-format)\n        * [`no-unsafe-query`](#user-content-eslint-plugin-sql-rules-no-unsafe-query)\n\n\n\u003ca name=\"user-content-eslint-plugin-sql-installation\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-installation\"\u003e\u003c/a\u003e\n## Installation\n\n1. Install [ESLint](https://www.github.com/eslint/eslint).\n1. Install [`eslint-plugin-sql`](https://github.com/gajus/eslint-plugin-sql) plugin.\n\n\u003c!-- --\u003e\n\n```sh\nnpm install eslint --save-dev\nnpm install eslint-plugin-sql --save-dev\n```\n\n\u003ca name=\"user-content-eslint-plugin-sql-configuration\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-configuration\"\u003e\u003c/a\u003e\n## Configuration\n\n1. Add `plugins` section and specify `eslint-plugin-sql` as a plugin.\n1. Enable rules.\n\n\u003c!-- --\u003e\n\n```json\n{\n  \"plugins\": [\n    \"sql\"\n  ],\n  \"rules\": {\n    \"sql/format\": [\n      2,\n      {\n        \"ignoreExpressions\": false,\n        \"ignoreInline\": true,\n        \"ignoreTagless\": true\n      }\n    ],\n    \"sql/no-unsafe-query\": [\n      2,\n      {\n        \"allowLiteral\": false\n      }\n    ]\n  }\n}\n\n```\n\n\u003ca name=\"user-content-eslint-plugin-sql-settings\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-settings\"\u003e\u003c/a\u003e\n## Settings\n\n\u003ca name=\"user-content-eslint-plugin-sql-settings-placeholderrule\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-settings-placeholderrule\"\u003e\u003c/a\u003e\n### \u003ccode\u003eplaceholderRule\u003c/code\u003e\n\nA regex used to ignore placeholders or other fragments of the query that'd make it invalid SQL query, e.g.\n\nIf you are using `?` placeholders in your queries, you must ignore `\\?` pattern as otherwise the string is not going to be recognized as a valid SQL query.\n\nThis configuration is relevant for `sql/no-unsafe-query` to match queries containing placeholders as well as for `sql/format` when used with `{ignoreTagless: false}` configuration.\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules\"\u003e\u003c/a\u003e\n## Rules\n\n\u003c!-- Rules are sorted alphabetically. --\u003e\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules-format\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules-format\"\u003e\u003c/a\u003e\n### \u003ccode\u003eformat\u003c/code\u003e\n\n_The `--fix` option on the command line automatically fixes problems reported by this rule._\n\nMatches queries in template literals. Warns when query formatting does not match the configured format (see Options).\n\nThis rule is used to format the queries using [sql-formatter](https://github.com/sql-formatter-org/sql-formatter).\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules-format-options\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules-format-options\"\u003e\u003c/a\u003e\n#### Options\n\nThe first option is an object with the following configuration.\n\n|configuration|format|default|description|\n|---|---|---|---|\n|`ignoreExpressions`|boolean|`false`|Does not format template literals that contain expressions.|\n|`ignoreInline`|boolean|`true`|Does not format queries that are written on a single line.|\n|`ignoreStartWithNewLine`|boolean|`true`|Does not remove `\\n` at the beginning of queries.|\n|`ignoreTagless`|boolean|`true`|Does not format queries that are written without using `sql` tag.|\n|`retainBaseIndent`|boolean|`true`|Uses the first line of the query as the base indent.|\n|`sqlTag`|string|`sql`|Template tag name for SQL.|\n\nThe second option is an object with the [`sql-formatter` configuration](https://github.com/sql-formatter-org/sql-formatter?tab=readme-ov-file#configuration-options).\n\n|configuration|default|description|\n|---|---|---|\n|`useTabs`|`false`|Use tabs for indentation.|\n|`tabSize`|2|Number of spaces per indentation.|\n|`language`|`sql`|Language of the query.|\n|`keywordCase`|`preserve`|Determines the case of keywords (`preserve`, `upper`, `lower`).|\n|`dataTypeCase`|`preserve`|Determines the case of data types (`preserve`, `upper`, `lower`).|\n|`denseOperators`|`false`|Decides whitespace around operators.|\n|`identifierCase`|`preserve`|Determines the case of identifiers (`preserve`, `upper`, `lower`).|\n|`functionCase`|`preserve`|Determines the case of functions (`preserve`, `upper`, `lower`).|\n|`paramTypes`|dialect default|Configures parameter placeholders. See [paramTypes documentation](https://github.com/sql-formatter-org/sql-formatter/blob/master/docs/paramTypes.md).|\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules-format-using-custom-parameter-placeholders\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules-format-using-custom-parameter-placeholders\"\u003e\u003c/a\u003e\n#### Using Custom Parameter Placeholders\n\nDifferent SQL dialects support different placeholder styles. By default, sql-formatter uses dialect-specific placeholders (e.g., `$1, $2` for PostgreSQL, `?` for MySQL). If you're using a different placeholder style like `:name`, you need to configure `paramTypes`.\n\nFor example, if you're using `:name` style placeholders with PostgreSQL:\n\n```js\n{\n  \"rules\": {\n    \"sql/format\": [\n      2,\n      {\n        \"sqlTag\": \"sql\"\n      },\n      {\n        \"language\": \"postgresql\",\n        \"paramTypes\": {\n          \"named\": [\":\"]\n        }\n      }\n    ]\n  }\n}\n```\n\nThe `paramTypes` object supports:\n\n|property|type|description|\n|---|---|---|\n|`positional`|`boolean`|Enable `?` positional placeholders.|\n|`numbered`|`('$' \\| ':' \\| '?')[]`|Prefixes for numbered placeholders (e.g., `$1`, `:1`).|\n|`named`|`('$' \\| ':' \\| '@')[]`|Prefixes for named placeholders (e.g., `:name`, `@name`).|\n|`quoted`|`('$' \\| ':' \\| '@')[]`|Prefixes for quoted placeholders (e.g., `:\"name\"`).|\n|`custom`|`{ regex: string }[]`|Custom placeholder patterns using regex.|\n\nThe following patterns are considered problems:\n\n```js\nsql.fragment`\n  SELECT\n    m1.ID\n  FROM\n    message m1\n  WHERE\n    m1.ID = ${message.id}\n`\n// Options: [{},{\"identifierCase\":\"lower\"}]\n// Message: undefined\n// Fixed code: \n// sql.fragment`\n//   SELECT\n//     m1.id\n//   FROM\n//     message m1\n//   WHERE\n//     m1.id = ${message.id}\n// `\n\nsql.fragment`\n  SELECT id::NUMERIC\n`\n// Options: [{},{\"dataTypeCase\":\"lower\",\"language\":\"postgresql\"}]\n// Message: undefined\n// Fixed code: \n// sql.fragment`\n//   SELECT\n//     id::numeric\n// `\n\nsql.fragment`\n  SELECT\n    COUNT(*)\n  FROM\n    message\n  WHERE\n    id = ${message.id}\n`\n// Options: [{},{\"keywordCase\":\"lower\"}]\n// Message: undefined\n// Fixed code: \n// sql.fragment`\n//   select\n//     COUNT(*)\n//   from\n//     message\n//   where\n//     id = ${message.id}\n// `\n\nsql.fragment`\n  select\n    COUNT(*)\n  from\n    message\n  where\n    id = ${message.id}\n`\n// Options: [{},{\"keywordCase\":\"upper\"}]\n// Message: undefined\n// Fixed code: \n// sql.fragment`\n//   SELECT\n//     COUNT(*)\n//   FROM\n//     message\n//   WHERE\n//     id = ${message.id}\n// `\n\nsql.fragment`\n  ${null}\nUPDATE message\nSET\n  messages = ${sql.jsonb(messages as unknown as SerializableValue[])}\nWHERE id = ${message.id}\n`;\n// Options: [{},{\"tabWidth\":4}]\n// Message: undefined\n// Fixed code: \n// sql.fragment`\n//   ${null}\n//   UPDATE message\n//   SET\n//       messages = ${sql.jsonb(messages as unknown as SerializableValue[])}\n//   WHERE\n//       id = ${message.id}\n// `;\n\nawait pool.query(sql.typeAlias('void')`\n  UPDATE message\n  SET\n    messages = ${sql.jsonb(messages as unknown as SerializableValue[])}\n  WHERE id = ${message.id}\n`);\n// Options: [{},{\"tabWidth\":4}]\n// Message: undefined\n// Fixed code: \n// await pool.query(sql.typeAlias('void')`\n//   UPDATE message\n//   SET\n//       messages = ${sql.jsonb(messages as unknown as SerializableValue[])}\n//   WHERE\n//       id = ${message.id}\n// `);\n\nsql`\n  SELECT\n    1\n`\n// Options: [{},{\"tabWidth\":4}]\n// Message: undefined\n// Fixed code: \n// sql`\n//   SELECT\n//       1\n// `\n\nsql.type({ id: z.number() })`\n  SELECT\n    1\n`\n// Options: [{},{\"tabWidth\":4}]\n// Message: undefined\n// Fixed code: \n// sql.type({ id: z.number() })`\n//   SELECT\n//       1\n// `\n\nsql.typeAlias('void')`\n  SELECT\n    1\n`\n// Options: [{},{\"tabWidth\":4}]\n// Message: undefined\n// Fixed code: \n// sql.typeAlias('void')`\n//   SELECT\n//       1\n// `\n\n`SELECT 1`\n// Options: [{\"ignoreInline\":false,\"ignoreTagless\":false},{}]\n// Message: undefined\n// Fixed code: \n// `\n//   SELECT\n//     1\n// `\n\n`SELECT 2`\n// Options: [{\"ignoreInline\":false,\"ignoreTagless\":false},{\"tabWidth\":2}]\n// Message: undefined\n// Fixed code: \n// `\n//   SELECT\n//     2\n// `\n\nsql.unsafe`SELECT 3`\n// Options: [{\"ignoreInline\":false},{}]\n// Message: undefined\n// Fixed code: \n// sql.unsafe`\n//   SELECT\n//     3\n// `\n\nsql.type()`SELECT 3`\n// Options: [{\"ignoreInline\":false},{}]\n// Message: undefined\n// Fixed code: \n// sql.type()`\n//   SELECT\n//     3\n// `\n\n`SELECT ${'foo'} FROM ${'bar'}`\n// Options: [{\"ignoreInline\":false,\"ignoreTagless\":false},{}]\n// Message: undefined\n// Fixed code: \n// `\n//   SELECT\n//     ${'foo'}\n//   FROM\n//     ${'bar'}\n// `\n\nconst code = sql`\n  SELECT\n      foo\n  FROM\n      bar\n`\n// Options: [{},{}]\n// Message: undefined\n// Fixed code: \n// const code = sql`\n//   SELECT\n//     foo\n//   FROM\n//     bar\n// `\n\nSQL`SELECT 1`\n// Options: [{\"ignoreInline\":false,\"sqlTag\":\"SQL\"},{}]\n// Message: undefined\n// Fixed code: \n// SQL`\n//   SELECT\n//     1\n// `\n\nsql`\n  SELECT hi !\n`\n// Options: [{},{}]\n// Message: undefined\n\nsql`\n  SELECT * FROM users WHERE name = :name AND id = :id\n`\n// Options: [{},{\"language\":\"mysql\",\"paramTypes\":{\"named\":[\":\"]}}]\n// Message: undefined\n// Fixed code: \n// sql`\n//   SELECT\n//     *\n//   FROM\n//     users\n//   WHERE\n//     name = :name\n//     AND id = :id\n// `\n\nSQL`\n  SELECT * FROM users WHERE user_id = :user_id\n`\n// Options: [{\"sqlTag\":\"SQL\"},{\"keywordCase\":\"upper\",\"language\":\"postgresql\",\"paramTypes\":{\"named\":[\":\"]}}]\n// Message: undefined\n// Fixed code: \n// SQL`\n//   SELECT\n//     *\n//   FROM\n//     users\n//   WHERE\n//     user_id = :user_id\n// `\n```\n\nThe following patterns are not considered problems:\n\n```js\n`\n# A\n## B\n### C\n`\n\nsql`SELECT 1`\n// Options: [{\"ignoreInline\":true},{}]\n\n`SELECT 2`\n// Options: [{\"ignoreTagless\":true},{}]\n\nconst code = sql`\n  SELECT\n    ${'foo'}\n  FROM\n    ${'bar'}\n`\n// Options: [{\"ignoreExpressions\":true,\"ignoreInline\":false,\"ignoreTagless\":false},{}]\n\nconst code = sql`\n  SELECT\n    ${'foo'}\n  FROM\n    ${'bar'}\n`\n// Options: [{},{}]\n\nconst code = sql`\n  DROP TABLE foo\n`\n// Options: [{},{}]\n\nconst code = sql`\n  DROP TABLE foo;\n\n  DROP TABLE foo;\n`\n// Options: [{},{}]\n```\n\n\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules-no-unsafe-query\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules-no-unsafe-query\"\u003e\u003c/a\u003e\n### \u003ccode\u003eno-unsafe-query\u003c/code\u003e\n\nDisallows use of SQL inside of template literals without the `sql` tag.\n\nThe `sql` tag can be anything, e.g.\n\n* https://github.com/seegno/sql-tag\n* https://github.com/gajus/mightyql#tagged-template-literals\n\n\u003ca name=\"user-content-eslint-plugin-sql-rules-no-unsafe-query-options-1\"\u003e\u003c/a\u003e\n\u003ca name=\"eslint-plugin-sql-rules-no-unsafe-query-options-1\"\u003e\u003c/a\u003e\n#### Options\n\nThe first option is an object with the following configuration.\n\n|configuration|format|default|description|\n|---|---|---|---|\n|`allowLiteral`|boolean|`false`|Controls whether `sql` tag is required for template literals containing literal queries, i.e. template literals without expressions.|\n|`sqlTag`|string|`sql`|Template tag name for SQL.|\n\nThe following patterns are considered problems:\n\n```js\n`SELECT 1`\n// Message: undefined\n\n`SELECT ${'foo'}`\n// Message: undefined\n\nfoo`SELECT ${'bar'}`\n// Message: undefined\n\n`SELECT ?`\n// Message: undefined\n\nfoo`SELECT ${'bar'}`\n// Options: [{\"sqlTag\":\"SQL\"}]\n// Message: undefined\n```\n\nThe following patterns are not considered problems:\n\n```js\nsql.unsafe`SELECT 3`\n\n`SELECT 1`\n// Options: [{\"allowLiteral\":true}]\n\nsql`SELECT 1`\n\nsql`SELECT ${'foo'}`\n\nSQL`SELECT ${'bar'}`\n// Options: [{\"sqlTag\":\"SQL\"}]\n```\n\n\n\n","funding_links":[],"categories":["Plugins"],"sub_categories":["Languages and Environments"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Feslint-plugin-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgajus%2Feslint-plugin-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgajus%2Feslint-plugin-sql/lists"}