Skip to content

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

  1. Open the table you want to export
  2. Click the Export button in the toolbar
  3. Choose your format:
    • JSON
    • SQL INSERT
  4. Choose destination:
    • Copy to clipboard
    • Save to file

Export Options

Copy to Clipboard

Quick export for immediate use:

  1. Select format (JSON or SQL)
  2. Click "Copy to Clipboard"
  3. Paste anywhere you need

Save to File

Save export to your filesystem:

  1. Select format (JSON or SQL)
  2. Click "Save to File"
  3. Choose location and filename
  4. File is saved with appropriate extension (.json or .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:

  1. Export from development database
  2. Use SQL INSERT in test environment
  3. Consistent test data across environments

Share Sample Data:

  1. Export subset of data as JSON
  2. Share with team members
  3. Easy to review and understand

Data Migration

Move Records Between Databases:

  1. Export from source database (SQL format)
  2. Run INSERT statements in target database
  3. Verify data integrity

Backup Specific Tables:

  1. Export table as SQL
  2. Store as backup
  3. Restore when needed

Documentation

API Documentation:

  1. Export sample data as JSON
  2. Use in API documentation
  3. Show realistic response examples

Data Structure Examples:

  1. Export to JSON
  2. Include in technical documentation
  3. Help developers understand schema

Data Analysis

Export for Analysis:

  1. Export to JSON
  2. Load in analysis tools (Python, R, etc.)
  3. Perform data analysis

Create Reports:

  1. Export data subset
  2. Import to reporting tools
  3. 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:

  1. Remove any active filters
  2. Reset sorting if needed
  3. Consider pagination settings
  4. Export

Data Type Handling

JSON Export

Database TypeJSON TypeExample
INTEGERnumber42
VARCHAR/TEXTstring"Hello"
BOOLEANbooleantrue
NULLnullnull
JSONstring"{\"key\": \"value\"}"
DATE/DATETIMEstring (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:

  1. Use filters to export specific records
  2. Export in chunks using pagination
  3. Consider performance impact

Sensitive Data

When exporting sensitive data:

  1. Review data before exporting
  2. Secure exported files appropriately
  3. Sanitize if sharing externally
  4. Don't commit to version control

File Organization

For file exports:

  1. Use descriptive filenames (e.g., users_backup_2024-01-15.sql)
  2. Create dedicated export folder
  3. Version control exclude exports
  4. Document export purpose

SQL Compatibility

When using SQL exports:

  1. Test on target database first
  2. Check syntax compatibility across database types
  3. Verify data types match
  4. Review constraints (unique, foreign keys)

Troubleshooting

Export Fails

If export doesn't work:

  1. Check permissions on target folder
  2. Verify disk space available
  3. Review table size (very large tables may timeout)
  4. Check DevDb output panel for errors

Encoding Issues

For special characters:

  1. Ensure UTF-8 encoding
  2. Check database character set
  3. Verify export file encoding

Large Exports

For very large tables:

  1. Export in smaller chunks
  2. Use database-native tools for massive exports
  3. Consider streaming options

Next Steps

DevDb Pro - Zero-config database management for VS Code