SQL Push (local)
The "SQL Push (local)" extension allows you to compare and push schema changes from your nuzur data model directly to a local database connection running on your machine.
Unlike the cloud SQL Push Extension, this local push relies on the nuzur local agent daemon running on your computer. This creates a secure, encrypted tunnel to modify your database schema without exposing your server to the internet.
Prerequisites
- Ensure the nuzur CLI is installed and your local agent is paired and running. (See Running a local agent for detailed instructions).
- Register a database connection in your local agent.
Setup & Execution
In the extensions panel, click on the "SQL Push (local)" extension. A modal window will appear where you need to select:
- Local Agent: Select which of your paired machines' local agents to use.
- Connection: Choose the specific local database connection registered on that agent.
- Schema: Select the target schema inside that database.
Once selected:
- The extension connects to your local database via the agent tunnel and fetches the remote schema.
- It performs a diff comparison between your nuzur model structure and the local schema.
- A SQL Diff report is displayed, showing the exact SQL commands (e.g.,
CREATE TABLE,ALTER TABLE, etc.) required to align the local database with your model. - Review the generated SQL script. If approved, click execute to apply the migration script to your local database.