{"id":26426336,"url":"https://github.com/prql/prql-vscode","last_synced_at":"2025-03-18T03:29:38.552Z","repository":{"id":65778581,"uuid":"473277878","full_name":"PRQL/prql-vscode","owner":"PRQL","description":"VS Code extension for PRQL lang","archived":false,"fork":false,"pushed_at":"2024-10-23T19:26:16.000Z","size":3126,"stargazers_count":24,"open_issues_count":7,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-24T06:06:49.871Z","etag":null,"topics":["prql","sql","vscode"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=PRQL-lang.prql-vscode","language":"TypeScript","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/PRQL.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-03-23T16:50:18.000Z","updated_at":"2024-10-23T19:26:19.000Z","dependencies_parsed_at":"2023-10-03T00:16:57.972Z","dependency_job_id":"24b7a377-63b7-4367-8f74-3ab1bd058667","html_url":"https://github.com/PRQL/prql-vscode","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRQL%2Fprql-vscode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRQL%2Fprql-vscode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRQL%2Fprql-vscode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PRQL%2Fprql-vscode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PRQL","download_url":"https://codeload.github.com/PRQL/prql-vscode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244149532,"owners_count":20406381,"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":["prql","sql","vscode"],"created_at":"2025-03-18T03:29:38.146Z","updated_at":"2025-03-18T03:29:38.544Z","avatar_url":"https://github.com/PRQL.png","language":"TypeScript","readme":"# PRQL extension for Visual Studio Code\n\n[![Apache-2.0 License](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](http://opensource.org/licenses/Apache-2.0)\n[![Version](https://vsmarketplacebadges.dev/version-short/PRQL-lang.prql-vscode.svg?color=orange)](https://marketplace.visualstudio.com/items?itemName=PRQL-lang.prql-vscode)\n[![Installs](https://vsmarketplacebadges.dev/installs-short/PRQL-lang.prql-vscode.svg?color=orange)](https://marketplace.visualstudio.com/items?itemName=PRQL-lang.prql-vscode)\n[![Downloads](https://vsmarketplacebadges.dev/downloads-short/PRQL-lang.prql-vscode.svg?color=orange)](https://marketplace.visualstudio.com/items?itemName=PRQL-lang.prql-vscode)\n[![Rating](https://vsmarketplacebadges.dev/rating-short/PRQL-lang.prql-vscode.svg?color=orange)](https://marketplace.visualstudio.com/items?itemName=PRQL-lang.prql-vscode)\n\nPRQL is a modern language for transforming data — a simple, powerful, pipelined\nSQL replacement.\n\nThis extension adds [PRQL](https://prql-lang.org/) support to VS Code.\n\n![PRQL Editor and SQL Preview](https://github.com/PRQL/prql-vscode/blob/main/docs/images/prql-vscode.png?raw=true)\n\n## Features\n\n- [PRQL](https://prql-lang.org/) language support and syntax highlighting\n- SQL Previews with Problems diagnostics and PRQL errors display updated on every keystroke as you type PRQL\n- Dedicated SQL Previews linked to open PRQL documents in VS Code editor\n- Restore open SQL Previews on VS Code reload\n- Copy SQL from an open SQL Preview to VS Code Clipboard\n- Generate SQL File PRQL editor context menu shortcut\n- View PRQL Settings editor context menu shortcut\n- PRQL compile target setting for the generated SQL dialect\n- Multi-target SQL generation and file naming options\n- Optional PRQL compiler signature comment append in generated SQL\n\n![PRQL Features](https://github.com/PRQL/prql-vscode/blob/main/docs/images/prql-vscode.gif?raw=true)\n\n### Feature Contributions\n\nPRQL extension contributes the following Settings, Commands, Languages and Activation Events to the VS Code:\n\n![PRQL VS Code Feature Contributions](https://github.com/PRQL/prql-vscode/blob/main/docs/images/prql-vscode-features.png?raw=true)\n\n## Configuration\n\nModify\n[User or Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings)\nin VS Code to change the default PRQL extension Settings globally or only for the open project workspace.\n\n![PRQL Extension Settings](https://github.com/PRQL/prql-vscode/blob/main/docs/images/prql-settings.png?raw=true)\n\nYou can use new `View PRQL Settings` PRQL editor context menu shortcut to access and modify PRQL extension Settings:\n\n![View PRQL Settings](https://github.com/PRQL/prql-vscode/blob/main/docs/images/prql-settings.gif?raw=true)\n\n### PRQL Settings\n\nPRQL extension Settings allow you to customize PRQL [compiler options](https://github.com/PRQL/prql/tree/main/prql-js#usage) and filenames of the generated SQL files. Use the ⚙️ PRQL Settings shortcut from the open PRQL document editor context menu to access and change these configuration options.\n\n| Setting                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |\n| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `prql.target`                         | Specifies the default PRQL compiler target dialect to use when generating SQL from pipeline definition files (`.prql`) globally or in an open vscode project workspace. Defaults to `Generic`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |\n| `prql.addCompilerSignatureComment`    | Adds `Generated by PRQL compiler version ...` signature comment with SQL target dialect info used to create SQL from PRQL document. Defaults to `true`. Set this setting to `false` to stop PRQL compiler from adding `Generated by ...` line to the end of the created SQL.                                                                                                                                                                                                                                                                                                                                                                                                                                          |\n| `prql.addTargetDialectToSqlFilenames` | Adds target dialect suffix to the generated SQL filenames when `Generate Sql File` PRQL document command is used. Defaults to `false`. Set this setting to `true` when targeting multiple database systems with different SQL flavors. For example, projects using [`PostgreSQL`](https://www.postgresql.org/) transaction database and [`DuckDB`](https://duckdb.org/) OLAP database management system for analytics can use this option to generate different SQL from PRQL query documents. PRQL extension will save generated SQL documents as `*.postgre.sql` and `*.duckdb.sql` when using `Generate SQL File` command with the currently selected `prql.target` in PRQL Settings set to `Postgre` or `DuckDB`. |\n\n### PRQL Target\n\nPRQL extension and the underlying [`prql-js`](https://github.com/PRQL/prql/tree/main/prql-js#usage) compiler used by this extension supports the following PRQL target dialect options: `Ansi`, `BigQuery`, `ClickHouse`, `DuckDb`, `Generic`, `MsSql`, `MySql`, `Postgres`, `SQLite`, `Snowflake`, and `Any`.\n\nThe `prql.target` extension setting default option value is `Generic`, which will produce SQL that should work with most database management systems. We recommend you set it to the target DB you are working with in your project [workspace settings](https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings).\n\nYou can also disable this PRQL compiler option in vscode extension by setting `prql.target` to `Any`. When `prql.target` is set to `Any`, PRQL compiler will read the target SQL dialect from `.prql` file header as described in [PRQL Language Book](https://prql-lang.org/book/project/target.html). For example, setting `prql.target` to `Any` and adding `prql target:sql.postgres` on the first line of your `.prql` query file will produce SQL for `PostgreSQL` database. Otherwise, `Generic` SQL flavor will be used for the generated SQL.\n\n## Deploying the Extension\n\nThis repo has the machinery to update the VSCode extension to the Microsoft Marketplace.\n\nWhen there is a new version of `prqlc` in `npm`, dependabot will PR an update.\nOnce per day, the _.github/dependabot.yml_ file checks NPM and compares the `dependencies.prqlc` property in _package.json_ to the latest version in NPM. If they differ, dependabot creates a PR for _package.json_.\n\nOnce that has been merged, the following manual steps will publish an update for the extension:\n\n- Update the [_CHANGELOG.md_](CHANGELOG.md) file, as needed\n\n- In _package.json_, update the `version` to match. This sets the version number of the extension itself.\n\n- Run `npm install` to update the `package-lock.json`\n\n- Create a new release from Github. This will start a workflow to release the current version to the VS Code Marketplace.\n\n- NB: From time to time, check the `node-version` in the files*.github/workflows/pull-request.yaml* and _.github/workflows/release.yml_. We track Node.js LTS - version 20 in June 2024.\n\n## Developing the Extension\n\n- Clone the repository and install dependencies:\n\n  ```sh\n  git clone git@github.com:prql/prql-vscode.git\n  cd prql-vscode \u0026\u0026 npm install\n  ```\n\n- Open the project in VS Code and start the TypeScript compilation task via\n  `Command Palette` -\u003e `Tasks: Run build task` -\u003e `npm: watch`. Alternatively,\n  you can run the compilation in your terminal directly:\n\n  ```sh\n  npm run watch\n  ```\n\n- Launch the extension in the Run and Debug panel. If you need to develop\n  against a local version of `prql-js`, use `npm link` and restart the\n  compilation task:\n\n  ```sh\n  npm link ../prql/prql-js\n  ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprql%2Fprql-vscode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprql%2Fprql-vscode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprql%2Fprql-vscode/lists"}