Safe SQL Executor is an extension for Visual Studio Code designed to be your ultimate safety net when interacting with databases. It intercepts destructive queries (UPDATE and DELETE) before they are accidentally executed, warning you about critical operations and allowing you to generate validation and backup queries with a single click.
It integrates seamlessly as your new "Universal Play Button" and is compatible with the most popular database extensions on the market.
Key Features
Destructive Operation Detection: Scans your text selection or active document. If it detects an UPDATE or DELETE, it pauses execution and displays a security alert.
Smart Pre-Validation: If you decide not to execute blindly, it automatically injects the following into your editor:
A SELECT COUNT(1) so you know exactly how many rows will be affected.
An exact SELECT * (inheriting your WHERE clause) ready for you to execute and save the data as a .csv natively before making the change.
The Ultimate "Play" Button: For harmless queries (like SELECT or INSERT), the extension acts transparently and executes them directly in your preferred database manager, saving you extra clicks.
Automatic Multi-Manager Support: Works out-of-the-box by intercepting execution commands from:
Microsoft SQL Server (mssql)
SQLTools
PostgreSQL Explorer
MySQL
How it works
The workflow is designed not to hinder your productivity, but to protect you when it matters most.
Select your SQL code (or select nothing to execute the whole file).
Click the blue shield and play icon in the top right corner of the editor, or press the shortcut Ctrl + Shift + S (Cmd + Shift + S on Mac).
If it is a SELECT: The query is executed immediately.
If it is an UPDATE or DELETE: A warning will pop up asking you:
Generate validation SELECT: Inserts the test and backup queries into your editor.
Execute anyway: Proceeds with the modification if you are absolutely sure.
Keyboard Shortcuts
Command
Windows / Linux
Mac
Context
Safe Execute
Ctrl + Shift + S
Cmd + Shift + S
Active SQL Editor
Requirements
This extension acts as an "Interceptor Shield". To actually execute the queries in the database, you need to have at least one of the following extensions installed and active:
Any software developer knows that forgetting a WHERE clause in a production UPDATE is one of the worst possible headaches. This tool was built with the mindset of "Better safe than restoring a backup," forcing a brief pause before pulling the trigger.
Developed to ensure you never accidentally drop or overwrite a table again.