The Scenario
You are a solutions architect at a consulting firm. You are three weeks into a database migration project for a client moving twelve application databases from their legacy Postgres cluster to Neon.
The migration plan requires documenting the current schema for each of the twelve main branches before any migration scripts run. The client wants the DDL in a Google Sheet, one row per branch, so the project manager can confirm sign-off branch by branch.
The bad version of the next afternoon:
- Connect to branch one using psql
- Run \d+ to get the table list
- Run pg_dump --schema-only and capture the output
- Copy the DDL into a sheet cell
- Close the connection, connect to branch two
- Repeat eleven more times
- Realize the output for branch seven is truncated
- You spend the last hour of the day troubleshooting a copy-paste artifact in a spreadsheet cell.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI reads the branch list from your sheet and retrieves the schema DDL from the Neon API for each one, so you never run psql commands or copy database output by hand.
Open the SheetXAI sidebar and type:
For each row in my sheet with a project_id in column A, branch_id in column B, and database name in column C, retrieve the schema DDL from Neon and write the full CREATE statements into column D.
SheetXAI calls the Neon API for each row, retrieves the schema, and writes the DDL output into column D. Twelve rows, twelve schema exports, all in the sheet without a single psql session.
What You Get
A complete schema documentation sheet with:
- Column D — the full DDL (CREATE TABLE, CREATE INDEX, constraints) for each branch and database
- Row-by-row traceability — each DDL is tied to the exact project ID and branch ID in columns A and B
- Client-ready format — the project manager can check off each row as the schema is reviewed and approved
The DDL is pulled live from the API, not from a connection string or a local file. The sheet reflects what is actually in each Neon branch.
What If the Data Is Not Quite Ready
Schema export projects rarely have clean input data. SheetXAI handles normalization and extraction in the same prompt.
When the branch IDs in the sheet are branch names, not IDs
Your team filled in branch names (like "main" or "feature-auth") instead of branch IDs.
For each row in my sheet, resolve the branch name in column B to the actual Neon branch ID for the project in column A. Write the branch ID into column B (replacing the name), then retrieve the schema DDL and write it into column D.
When you only need specific tables, not the full schema
The project manager only wants the DDL for tables that contain PII fields, not the full schema of each database.
For each row in my sheet with a project_id in column A, branch_id in column B, and database name in column C, retrieve the schema DDL from Neon. Then filter the DDL to include only CREATE TABLE statements for tables whose names contain 'user', 'patient', or 'account'. Write the filtered DDL into column D.
When some rows have a blank database name
Several rows are missing the database name in column C because the team assumed the default database name. Neon's default database is typically named "neondb."
For any row where column C is blank, use 'neondb' as the database name. Then retrieve the schema DDL for each row and write it into column D.
When the client wants a summary table count alongside the DDL
The project manager wants to know how many tables each schema contains, not just the raw DDL.
For each row in my sheet with a project_id in column A, branch_id in column B, and database name in column C, retrieve the schema DDL from Neon and write it into column D. Count the number of CREATE TABLE statements in the DDL and write that count into column E as 'Table Count'.
The pattern: the sheet is the audit trail. One prompt populates the DDL column and every downstream approval step works from the same source of truth.
Try It
Get the 7-day free trial of SheetXAI and open any sheet with Neon project IDs and branch IDs, then ask it to retrieve the schema DDL. The Neon integration is included in every plan. See also how to compare Neon branch schemas in a sheet or the Neon in Google Sheets overview.
