Moving from Firebase to PostgreSQL: a schema design guide
A careful migration starts with the queries your app needs, then turns document paths into relational tables without forcing every value into a rigid shape.
Add Aurabase’s MCP server to your editor, check what it can access, then use schema context to draft SQL and TypeScript you can verify.
An AI editor can write plausible SQL without knowing your database. An MCP connection can give it the schema context it needs to make a more grounded draft. Aurabase supports MCP integration for AI agents and code editors, including Cursor and Windsurf.
The setup has two parts: configure the Aurabase MCP server in your editor, then verify the access it grants. Aurabase’s published setup material describes tools for working across the backend, including inspecting tables, running SQL and generating TypeScript types. The exact server details and configuration syntax can change, so use Aurabase’s current MCP setup instructions rather than copying a configuration example from an unrelated project.
Open Aurabase’s MCP setup instructions and follow the values and steps it provides for your project. Keep the server address, authentication details and any required command exactly as documented. Do not guess a URL, invent a token field or reuse a configuration snippet for another MCP server.
MCP settings are specific to each editor and can change between releases. In Cursor or Windsurf, use the editor’s current MCP configuration process to add the Aurabase server. If the editor asks for a name, choose one that makes the connection easy to identify, such as “Aurabase.” Add only the connection details the Aurabase instructions specify.
PayAPI’s guide to connecting Cursor or Claude Desktop to an MCP server is useful for understanding the editor-side pattern. Treat it as background, not as a source for Aurabase’s server address or credentials.
Before asking the editor to inspect a database, check which project the connection targets and what tools are available. Aurabase describes a read-only mode, a tool allow-list and a key per project. Those controls matter: an agent that only needs schema context should not receive broader access just because the connection can support more tasks.
Start with read-only access if that fits the work. Restrict the tool allow-list to the operations needed for the task. Keep credentials in the editor’s supported configuration or secret storage, not in a prompt, source file or committed project configuration. Treat access controls as a boundary to verify, not as a reason to approve every generated operation.
When you are unsure what an operation can change, pause and check the current Aurabase documentation and your project’s permissions before running it. A generated query is still a proposal. Review it as you would code from a colleague, especially if it writes or deletes data.
Start with a question that has a clear answer and does not require a write. For example: “List the tables in this project and summarize the columns relevant to devices. Do not run a migration or change data.” Check the response against the schema you expect. If the agent cannot see the relevant table, check the selected project, connection setup and allowed tools before changing your prompt.
Then ask for a narrow piece of code: “Draft a PostgreSQL query that selects the id, temperature and last_seen fields from devices, ordered by last_seen, with a limit of 50. Show the SQL and explain the assumptions. Do not execute it.” Compare the names and types with the actual schema. MCP context can improve a draft; it does not establish that the query matches your application’s intent or is safe to run.
Aurabase says it automatically generates TypeScript type definitions from database schemas. Its MCP material also describes generating TypeScript types. That gives an agent a route from database structure to code suggestions, but you should still verify that the types are current and that the generated code uses the right fields.
Ask for a small, reviewable change first. For example, request a TypeScript query for the same device fields and ask the agent to identify the schema details it relied on. Check the result in your project, run the checks your team normally uses, and compare the output with the generated types. If schema changes are involved, review and apply them through your normal migration process rather than treating an agent’s draft as approval.
A working MCP setup should make an ordinary task easier: inspect a table, draft a query, or connect database fields to application code without switching tools. It should not turn every editor prompt into permission to operate your backend. Keep the project scope clear, limit the available tools to the job and ask the agent to show its assumptions.
For a first pass, confirm the editor connects, ask it to identify a known table, and compare its answer with the source of truth. Then test one read-only query without executing it. Only expand access when a task requires it and you have reviewed the relevant permissions. That sequence makes AI database context useful while leaving the decisions that matter with the developer.
A careful migration starts with the queries your app needs, then turns document paths into relational tables without forcing every value into a rigid shape.
Pour un portail client, associer un lien de connexion par e-mail à un code TOTP exige de contrôler où la session devient réellement fiable.
Le SDK Rust d’Aurabase ouvre une voie vers son backend PostgreSQL, mais ne remplace ni les mesures de charge ni le choix de la bonne frontière de service.