Data Export
DevDb Pro allows you to export table data in multiple formats, making it easy to share data, create backups, or migrate records between environments.
Supported Export Formats
JSON Format
Export table data as well-formatted JSON:
- Pretty-printed with proper indentation
- Array of objects structure
- Type-preserved values
- NULL values clearly indicated
SQL INSERT Statements
Export as executable SQL INSERT statements:
- Ready to run SQL syntax
- Proper value escaping and quoting
- NULL handling in SQL format
- Compatible with target database
How to Export
From the Table View
- Open the table you want to export
- Click the Export button in the toolbar
- Choose your format:
- JSON
- SQL INSERT
- Choose destination:
- Copy to clipboard
- Save to file
Export Options
Copy to Clipboard
Quick export for immediate use:
- Select format (JSON or SQL)
- Click "Copy to Clipboard"
- Paste anywhere you need
Save to File
Save export to your filesystem:
- Select format (JSON or SQL)
- Click "Save to File"
- Choose location and filename
- File is saved with appropriate extension (
.jsonor.sql)
Export Examples
JSON Export Example
json
[
{
"id": 1,
"name": "John Doe",
"email": "[email protected]",
"created_at": "2024-01-15T10:30:00.000Z",
"is_active": true,
"metadata": null
},
{
"id": 2,
"name": "Jane Smith",
"email": "[email protected]",
"created_at": "2024-01-16T14:22:00.000Z",
"is_active": true,
"metadata": "{\"role\": \"admin\"}"
}
]SQL INSERT Export Example
sql
INSERT INTO users (id, name, email, created_at, is_active, metadata)
VALUES (1, 'John Doe', '[email protected]', '2024-01-15 10:30:00', true, NULL);
INSERT INTO users (id, name, email, created_at, is_active, metadata)
VALUES (2, 'Jane Smith', '[email protected]', '2024-01-16 14:22:00', true, '{"role": "admin"}');Use Cases
Development & Testing
Seed Test Data:
- Export from development database
- Use SQL INSERT in test environment
- Consistent test data across environments
Share Sample Data:
- Export subset of data as JSON
- Share with team members
- Easy to review and understand
Data Migration
Move Records Between Databases:
- Export from source database (SQL format)
- Run INSERT statements in target database
- Verify data integrity
Backup Specific Tables:
- Export table as SQL
- Store as backup
- Restore when needed
Documentation
API Documentation:
- Export sample data as JSON
- Use in API documentation
- Show realistic response examples
Data Structure Examples:
- Export to JSON
- Include in technical documentation
- Help developers understand schema
Data Analysis
Export for Analysis:
- Export to JSON
- Load in analysis tools (Python, R, etc.)
- Perform data analysis
Create Reports:
- Export data subset
- Import to reporting tools
- Generate visualizations
Export Filtering
Current View Export
DevDb exports the currently displayed data:
- Applied filters are respected
- Current sort order is maintained
- Pagination affects export (exports current page by default)
Full Table Export
To export the entire table:
- Remove any active filters
- Reset sorting if needed
- Consider pagination settings
- Export
Data Type Handling
JSON Export
| Database Type | JSON Type | Example |
|---|---|---|
| INTEGER | number | 42 |
| VARCHAR/TEXT | string | "Hello" |
| BOOLEAN | boolean | true |
| NULL | null | null |
| JSON | string | "{\"key\": \"value\"}" |
| DATE/DATETIME | string (ISO 8601) | "2024-01-15T10:30:00.000Z" |
SQL Export
- Strings - Single-quoted and escaped
- Numbers - Unquoted
- Booleans - Database-specific format (
true/1) - NULL - SQL NULL keyword
- Dates - Proper date format for target database
Best Practices
Large Tables
For tables with many rows:
- Use filters to export specific records
- Export in chunks using pagination
- Consider performance impact
Sensitive Data
When exporting sensitive data:
- Review data before exporting
- Secure exported files appropriately
- Sanitize if sharing externally
- Don't commit to version control
File Organization
For file exports:
- Use descriptive filenames (e.g.,
users_backup_2024-01-15.sql) - Create dedicated export folder
- Version control exclude exports
- Document export purpose
SQL Compatibility
When using SQL exports:
- Test on target database first
- Check syntax compatibility across database types
- Verify data types match
- Review constraints (unique, foreign keys)
Troubleshooting
Export Fails
If export doesn't work:
- Check permissions on target folder
- Verify disk space available
- Review table size (very large tables may timeout)
- Check DevDb output panel for errors
Encoding Issues
For special characters:
- Ensure UTF-8 encoding
- Check database character set
- Verify export file encoding
Large Exports
For very large tables:
- Export in smaller chunks
- Use database-native tools for massive exports
- Consider streaming options
Next Steps
- Database Client - Master the interface
- Configuration - Database setup
- Quick Table Access - Navigate efficiently