The Simplest Way to Make Cloud SQL and IntelliJ IDEA Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Engineers pair cloud sql and intellij idea to run queries from their code editor. This setup lets your team inspect tables, debug app data, and test schema changes. Making these two tools work well together takes clear role planning and network rules. Without strict boundaries, local editors can hold static keys that put production tables at risk. How cloud sql and intellij idea share roles and data IntelliJ IDEA includes a built-in database tool that talks to remote database instances. Deve

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Engineers pair cloud sql and intellij idea to run queries from their code editor. This setup lets your team inspect tables, debug app data, and test schema changes.

Making these two tools work well together takes clear role planning and network rules. Without strict boundaries, local editors can hold static keys that put production tables at risk.

How cloud sql and intellij idea share roles and data

IntelliJ IDEA includes a built-in database tool that talks to remote database instances. Developers enter a host address, user name, and secret to open a session. Once the session starts, the editor pulls table lists and runs SQL statements.

In Cloud SQL for PostgreSQL, the database uses specific rules for admin roles. Because it is a managed service, customers do not get true superuser attributes. Instead, you can assign the cloudsqlsuperuser role to accounts that need elevated rights. This role lets a user create extensions, event triggers, and replication publications.

The default postgres admin user belongs to this cloudsqlsuperuser role out of the box. It starts without a password, so you must set one before you log in. This default user can create roles and databases, and it has login rights. Still, it does not hold true superuser or replication attributes on the instance.

A Google-managed system user called cloudsqladmin holds the actual superuser privileges on the server. Customers cannot delete or change Cloud SQL system roles or users at any time. When you link your editor, you log in with a customer-managed account instead.

Common failure modes and how to scope roles

Many teams take shortcuts when they set up local database tools for engineers. The most common mistake is sharing the default postgres user across the whole team. Everyone saves that single password inside their local editor settings on their laptops.

End-to-End Encryption + SQL Query Filtering: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

When five developers share one login, your logs cannot show who ran a query. If someone drops a table by mistake, you cannot trace the action back. Also, if an engineer leaves the company, you must rotate that shared password. That rotation breaks the saved setup for every other person on the team.

Broad permissions create another big risk for production databases connected to code editors. If a developer logs in with the cloudsqlsuperuser role, they can alter critical schemas. A simple typo in a query window can delete rows or lock tables.

Unlogged queries and exposed personal data also cause problems during daily debugging work. Tables often hold sensitive fields like emails, phone numbers, card numbers, or national IDs. Pulling large result sets into a local editor spreads that sensitive data to laptops. Implementing data masking rewrites matched fields in results to reduce this exposure on machines.

To fix these issues, stop using the default admin account for daily editor work. Create separate database roles for read-only work and for schema changes. Grant each role only the exact table permissions needed for the task at hand.

Keep network paths tight between developer laptops and your cloud database instances. Do not open your database port to the whole internet just for easy access. Restrict network paths to trusted sources, and keep admin rights away from daily sessions. Review role grants often to make sure old accounts do not keep extra rights.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can I use a true PostgreSQL superuser from IntelliJ IDEA?

No, Cloud SQL is a managed service and does not give customers superuser attributes. You can use the cloudsqlsuperuser role instead to create extensions or event triggers.

Why does the default postgres login fail on a new instance?

The default postgres admin user is created without a password on new instances. You must set a password for this user before you can log in.

Should developers use the cloudsqlsuperuser role for daily debugging?

No, daily debugging should use a scoped read-only role with limited table permissions. Reserve the cloudsqlsuperuser role for setup tasks like creating extensions or replication users.

The query runs. The emails stay hidden.