3.4. Importing Database Schema via CSV
Last updated
Last updated
Our SQL generator tool allows you to import your database schema information using a CSV file. This feature is particularly useful when you want to quickly transfer your database structure without writing DDL statements manually.
Navigate to the "Upload SQL Schema CSV File" screen in the tool.
You'll see a form with the following elements:
A text input field labeled "File Name*"
An upload area with the message "Click to upload a CSV file."
A "Finish" button at the bottom
Enter a name for your file in the "File Name" field. This doesn't have to match the actual filename, but should be descriptive. For example, you might enter "customers" for a schema related to customer data.
Click on the upload area. This will open a file browser on your computer.
Select the CSV file containing your schema information.
Once your file is selected, it will appear in the upload area.
Click the "Finish" button to complete the upload process.
To create the CSV file for upload, you'll need to run a query on your database to extract the schema information. Here are queries for common database systems:
Replace "YOUR_DATABASE_NAME" with the name of your database.
Run the appropriate query for your database system.
Export the results to a CSV file.
Ensure the CSV file has the following headers: Schema,Table,Column,Type
Save the file with a .csv extension.
Your CSV file should look like this:
Ensure your CSV file contains only schema information, not actual data.
The tool expects the CSV to have the exact column headers as shown above.
If your database doesn't use schemas, you can leave the Schema column blank or use a placeholder value.
Large databases may result in large CSV files. If you encounter issues, consider splitting your schema into multiple CSV files.
After uploading, you can use our tool to visualize, modify, or generate SQL from your schema. If you encounter any issues during the upload process, please check our troubleshooting guide or contact our support team.