{"templateId":"markdown","sharedDataIds":{},"props":{"metadata":{"markdoc":{"tagList":["blog-author","blog-share"]},"type":"markdown"},"seo":{"title":"Visual Studio Code extension for Treasure Data","description":"Boost Your Data Analysis Workflow with TD Query Tool for VS Code.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]},"image":"/assets/vs_td.1132cb0539ff1b532ec4ea1d2abdb455ba650d7d6a445beeb8c110393a354fd3.275e2917.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"visual-studio-code-extension-for-treasure-data","__idx":0},"children":["Visual Studio Code extension for Treasure Data"]},{"$$mdtype":"Tag","name":"BlogAuthor","attributes":{"name":"Toru Takahashi","date":"2023-08-01","image":"./images/toru.png"},"children":[]},{"$$mdtype":"Tag","name":"BlogShare","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the world of data analysis and manipulation, having the right tools at your disposal can make a significant difference in your productivity and efficiency. One such tool that deserves attention is the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://marketplace.visualstudio.com/items?itemName=treasure-data.td-query-tool"},"children":["TD Query Tool (TDQT)"]}," extension for Visual Studio Code. This powerful extension empowers data professionals to perform complex queries and analyses within the familiar environment of VS Code."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://marketplace.visualstudio.com/items?itemName=treasure-data.td-query-tool"},"children":["Treasure Data Query Tool"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"setup","__idx":1},"children":["Setup"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/setup.879a0c6f7fb74a4c90940f86e37d4e8743d5ebec05bd809999dd1297386073eb.275e2917.gif","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the Extensions Marketplace, search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure Data"]}," and find the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure Data Query Tool"]}," extension. Click on the \"Install\" button to install the extension."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After installation, go back to the Command Palette and search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDQT Select API Host"]},". Select this command and choose the desired endpoint from the available options."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Next, go to the Command Palette again and search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDQT Add APIKEY"]},". Select this command and enter your Treasure Data master API key when prompted."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"use","__idx":2},"children":["Use"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["TDQT provides browsing and querying capabilities across your databases."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"browsing-databases-tables-and-saved-queries","__idx":3},"children":["Browsing Databases, Tables and Saved Queries"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After installing the extension, you will see the Treasure Data sidebar icon. Click on it to reveal the list of databases, tables, and saved queries."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Right-click on a database to access the following options:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Copy Database Name and Table Name"]}," - Copies the names of the selected database and table for later use."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Select Top 100"]}," - Executes a query to select the top 100 rows from the table and displays the results."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Show Table Schema"]}," - Shows the schema of the selected table."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When expanding a database tree, the table schema will be displayed. Right-clicking on a column in the schema allows you to copy the column name for use in queries."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Queries list displays saved queries that you can open in the editor."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/menu.2e76dbf3b3db999d14b3a13987e54d2e300f19fe8d76997e7e381404e705e97f.275e2917.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"running-queries","__idx":4},"children":["Running Queries"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To run a query, open a blank editor window or select a previously saved query."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDQT: Run Query"]},". Select this command to start a new job on Treasure Data with the query from the current window."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An output window will show the progress of the job as it runs on the Treasure Data service."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Once the job is completed, another window will appear displaying the output of the query. You can inspect and analyze the results directly in the Visual Studio Code environment."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/result.2d27da91d4f919d1ab57a3e34d7305bcf56bd58cf3e8c8ed5d7aba73df6e1a81.275e2917.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"vs-code-ecosystem","__idx":5},"children":["VS Code ecosystem"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["VS Code has a lot of great extensions that allow you to write SQL effectively. A combination of these extensions can help your day to day SQL life!"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Here is some useful extensions I like!"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://marketplace.visualstudio.com/items?itemName=inferrinizzard.prettier-sql-vscode"},"children":["Prettier SQL VSCode"]},": Formats SQL files using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sql-formatter"]}," library"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://marketplace.visualstudio.com/items?itemName=dorzey.vscode-sqlfluff"},"children":["sqlfluff"]},": A linter and auto-formatter for SQLFluff, a popular linting tool for SQL and dbt."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"appendix-supported-commands","__idx":6},"children":["Appendix: Supported Commands"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/command.913b0c665c0040a51ce689e69a11fdad714208b38163cb15180eb9afdb158acc.275e2917.png","alt":""},"children":[]}]},{"$$mdtype":"Tag","name":"details","attributes":{},"children":[{"$$mdtype":"Tag","name":"summary","attributes":{},"children":["\nExpand this section for a full list of supported commands in the Command Pallet.\n"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.runQuery",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Run Query\teditor/title"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.showTableSchema",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Show Table Schema"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.openQuery",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Open Query"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.selectQuery",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Select and Open Query"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.validateQuery",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Validate Query"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.setQueryEngine",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Select Query Engine"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.refreshDatabases",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh commandPaletteview/title"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.refreshQueries",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Refresh\tcommandPaletteview/title"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.copyDatabaseName",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy Database Name"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.copyTableName",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy Database and Table Name"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.copyColumnName",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy Column Name"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.addPreset",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Add Preset"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.selectPreset",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Select Preset"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.deletePreset",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Delete Preset"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.updatePreset",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Update Preset"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.saveQuery",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Save Query"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.selectTop100",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select Top 100"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["td-query-tool.showJobsHistory",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Show Jobs History"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the API host via the command palette",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Select API Host Domain"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the API Key via the command palette",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TDQT: Add API Key. Add an API key with Read permissions on the account."]}]}]}]}]}]},"headings":[{"value":"Visual Studio Code extension for Treasure Data","id":"visual-studio-code-extension-for-treasure-data","depth":1},{"value":"Setup","id":"setup","depth":1},{"value":"Use","id":"use","depth":1},{"value":"Browsing Databases, Tables and Saved Queries","id":"browsing-databases-tables-and-saved-queries","depth":2},{"value":"Running Queries","id":"running-queries","depth":2},{"value":"VS Code ecosystem","id":"vs-code-ecosystem","depth":1},{"value":"Appendix: Supported Commands","id":"appendix-supported-commands","depth":1}],"frontmatter":{"title":"Visual Studio Code extension for Treasure Data","author":"Toru","date":"2023-08-01T00:00:00.000Z","categories":["developer-tool","vscode","presto","hive"],"image":"vscode-tdqt/vs_td.png","seo":{"title":"Visual Studio Code extension for Treasure Data","description":"Boost Your Data Analysis Workflow with TD Query Tool for VS Code.","image":"/assets/vs_td.1132cb0539ff1b532ec4ea1d2abdb455ba650d7d6a445beeb8c110393a354fd3.275e2917.png"}},"lastModified":"2026-06-04T10:17:23.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/blog/vscode-tdqt","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}