Walkthroughs

Connect to a production database safely

You connect the demo shop's production database to NeoSQL and add safeguards one after another so that data and schemas cannot be changed by mistake. When you finish, the production connection stands out in red with a watermark, anything other than a query is blocked or confirmed, and AI and external MCP clients follow the same rules. Who sets each safeguard and which executions it covers is explained in Safeguards for production databases. The focus is the order in which to add them and why.

Where you can use itWebDesktopWithout signing inSigned inLocal projectsAccount projects

Before you start

  • Get two database accounts. One with SELECT privileges only for querying, and one you use only when changing data. NeoSQL's safeguards cover only the execution paths inside NeoSQL and are personal settings that differ per teammate. Only database account privileges apply the same way from every tool, so decide them first.
  • Use the desktop app. Production database firewalls usually accept connections only from inside the company or from developer devices. The web app connects from the NeoSQL server, so it cannot reach such databases (Web and desktop).
  • Decide the project type. A local project is enough if you work alone. If teammates share it and you need DDL approval and masking, sign in and use an account project. The type cannot be changed later (Sign-in and project types).
  • Have the database server's address and port ready, the CA certificate file if you use SSL, and the SSH server's address and account if you go through a bastion host.

Create the connection in the desktop app

Create the connection with the query account first. If you set the secure connection and the profile before saving, there is never a moment when the production database is connected without a profile.

  1. Open the project and click the Add connection button in the explorer. Choose the DBMS, click the Connect to DB button, and enter the host, port and query account. Result: The connection fields open, and the connection is not saved yet. Each field is described in Create and edit a connection.
  2. On the SSL/SSH tab, turn on the SSL/TLS switch, choose the Verify Full mode, and upload the CA certificate in the CA Certificate row. If you connect by IP address or through an SSH tunnel, choose the Verify CA mode. Result: Traffic is encrypted, and NeoSQL also checks that the other end really is the database server. The initial Require mode only encrypts and does not check the other end.
  3. If you must go through a bastion host, turn on the SSH Tunnel switch on the same tab, enter the SSH server and account, and turn on the Strict host key checking option. Result: NeoSQL reaches the database through the SSH server and notices if the SSH server changes. Each field is described in SSL/TLS and SSH tunnels.
  4. Go back to the Connection tab and click the Test Connection button. Result: This checks that the database is reachable from your device. Do not save yet. The next section sets the profile in the same dialog.

Mark the production environment with a profile

  1. Open the Profile tab in the same connection dialog and click the Prod button in the Environment field (1). Result: The color becomes red, the background watermark turns on, and the protection mode becomes Confirm (DDL + risky DML), all at once.
  2. This connection is for querying, so choose Read-only (block non-SELECT) in the Protection mode field (6). Result: The SQL editor, the AI Assistant panel and external MCP clients run nothing but queries on the connection.
  3. Click the Save button. Result: The connection and its profile are saved together. The connection's SQL tabs show a red work tab marker and a red line next to the line numbers, with the connection name in the background.
  • Create the connection you use to change data separately with the change account, click the Prod button the same way, and leave the protection mode at Confirm (DDL + risky DML). Give the two connections names you can tell apart.
  • The profile is a personal setting. Each teammate in an account project must set their own (Connection profiles).
  • A public connection in an account project shares its database user and password with the team. If you create the change connection as a public connection, every teammate connects with that account (Connections and execution targets).
  • When you save the connection, a dialog may ask whether to create a dashboard that monitors it. If you do, queries that read server status go to the production database right away; if you want one, add only the tiles you choose later by following Watch your database with a dashboard.

Use a transaction when changing data

When you change data on the change connection, separate running from committing, so that you can look at the result before you commit it.

  1. Open a SQL tab on the change connection and, before running anything, turn off the Auto Commit switch (1) in the toolbar. Result: The Commit and Rollback buttons (2) appear, and from now on the statements you run stay in a transaction.
  2. Run a statement with a WHERE, such as UPDATE orders SET status = 'CANCELLED' WHERE order_id = 1003. Result: Even with the protection mode at Confirm (DDL + risky DML), an UPDATE with a WHERE runs without asking. Markers for uncommitted changes appear on the toolbar and the work tab.
  3. Check the changed rows with a SELECT, then click the Commit button. If something is wrong, click the Rollback button. Result: Only then are the changes committed to the database or undone.
  • On a SQL tab in the production environment, NeoSQL rolls back a transaction left open for 30 minutes (the initial value) with no activity. Even if you forget to commit and walk away, locks are not held for long. The values are explained in Connection profiles.
  • On MySQL, MariaDB and Oracle, running DDL also commits the changes made so far. Do not mix DDL into an open transaction (SQL execution and transactions).
  • Editing cells in the result grid and applying ERD changes to the database also go through the protection mode, but not the dangerous SQL check. Always read the SQL shown before it runs.

Narrow what AI and external MCP clients may do

The AI Assistant panel and external MCP clients can write and run SQL before a person reads each statement. So keep the AI policy for a production connection as narrow as possible.

  1. Click the AI Settings button at the top of the project screen. Result: The table where you set the AI and MCP policy per connection opens. The AI Assistant panel and external MCP clients both follow the table.
  2. To hide the production database from AI entirely, turn off the production connection's Enabled option (1). Result: The connection cannot be chosen in the AI Assistant panel, and every request from an external MCP client is refused. If you turn it off here, you do not need the steps below.
  3. If you let AI use it, check that the Schema changes option (3) and the Data changes option (4) are off, and also turn off the Allow data transfer option (5). Result: Changes written by AI are confirmed before they run, and data changes from external MCP clients are left uncommitted. NeoSQL also asks before AI queries real rows and sends them to the AI provider. The Allow data transfer option is on for new connections.
  4. In an account project, turn on the Always mask sensitive data option (6) and click the Save button. Result: Sensitive columns are masked in results sent to AI and external MCP clients, regardless of role.

The connection protection mode applies before the AI policy. The AI Assistant panel and the external MCP clients' execute-query follow the same rules as the SQL editor.

Protection modeThe AI Assistant panel and external MCP clients
Read-only (block non-SELECT)Nothing but queries runs, including INSERT, UPDATE and DELETE. If several statements are sent together and any one is caught, none of them runs
Confirm (DDL + risky DML)DDL and UPDATE or DELETE without a WHERE open a confirmation dialog in NeoSQL. A request from an external MCP client is not run if you do not answer within 45 seconds
  • When a request from an external MCP client is refused because of a setting, a MCP execution request rejected notification appears in NeoSQL. It tells you who tried what.
  • NeoSQL enforces these rules even if the external MCP client is set to approve tools automatically. Queries are not blocked, though, so for a database whose query results must not reach the external client's model, turn off the Enabled option as in step 2 (AI and MCP).

In an account project, add the team safeguards

In an account project, the project owner sets safeguards per role. Unlike profiles, these settings apply to every teammate. Skip this section for a local project.

  1. Open the Project settingsRole Permissions tab with the owner account, and turn on the DDL Restriction option for roles that must not change the production schema directly. Choose the approving role in the Approver Role field and save. Result: Members of the role cannot run DDL directly from the SQL editor, the ERD, the AI Assistant panel or external MCP clients, and send database changes as approval requests (DDL approval).
  2. On the same tab, turn on the Sensitive Data Masking option for roles that must not see customer information, and save. Result: The role sees values in sensitive columns and values matching patterns masked. No columns are marked yet.
  3. In an ERD or a table tab, right-click the email column of the customer table and choose the Mark as sensitive menu. Mark the name column and the line1 column of the address table the same way. Result: The marks are saved right away, and those values are masked for masked roles in the result grid, exports, AI and MCP results (Column masking).

Check that it blocks

A safeguard is not done just because you set it. If you check that it works, the place you trust to protect you will not turn out to be uncovered later.

  1. On a SQL tab of the query connection, try running UPDATE orders SET status = 'PAID' WHERE order_id = 1003. Result: It does not run, and a read-only notice appears. What it looks like is shown under 'How read-only connections block statements' in Dangerous SQL confirmation.
  2. On a SQL tab of the change connection, start running DELETE FROM review without a WHERE, and click the Cancel button in the confirmation dialog. Result: One protection mode confirmation shows both the protection mode reason and the dangerous SQL reason, and cancelling runs nothing.
  3. If you use AI, choose the query connection as the context in the AI Assistant panel and ask it to "set order 1003 to cancelled". Result: The UPDATE written by AI does not run. The same request from an external MCP client is refused, and a notification appears in NeoSQL.

What's next