Skip to content

History

History automatically logs executed SQL queries, allowing you to review, reuse, and manage past queries with ease.

By default, the History feature is disabled. In the DBCode Explorer, open the History view.

History panel in DBCode

Click Enable history to start recording executed SQL queries.

Enable history in DBCode

  1. Open DBCode in Visual Studio Code:

    • Launch Visual Studio Code and click the DBCode icon in the Activity Bar on the left.

    DBCode icon in VS Code

  2. Open the History Panel:

    • In the DBCode sidebar, click the History view to access the list of previously executed queries.

    History panel view

  1. View Past Queries:

    • The History panel shows a chronological list of queries grouped by connection and database.
    • Use the Expand All icon to see all details or the Queries Only icon to show a list of queries from all connections and databases.
    • Apply filters using the Filter icon to narrow your view based on specific criteria.

    Query history list

  2. Re-Run a Query:

    • Click the Load Query icon next to any query to reload it into a new editor tab for the selected database connection.

    Re-run a saved query

  3. Edit and Copy Queries:

    • Use the Copy SQL icon to duplicate a query. Paste it into the editor to modify or use as a new template.

    Copy a query from history

  4. Delete History:

    • To delete a query, click the Delete icon next to it. Confirm the action by selecting “Yes” in the prompt. Individual queries or all queries for a database can be deleted.

    Clear query history

  • Time-Saving: Quickly re-run frequently used queries without retyping.
  • Efficient Troubleshooting: Easily review past queries to identify and resolve issues.
  • Organized Workflow: Maintain a comprehensive log of query development for easy reference.

Enabling and using the History can streamline your workflow and make database interactions in Visual Studio Code more efficient and organized.