Database Schema Explorer avatar
Database Schema Explorer

Pricing

from $0.01 / 1,000 results

Go to Apify Store
Database Schema Explorer

Database Schema Explorer

This Apify Actor connects to various types of databases (SQLite, PostgreSQL, MySQL, Oracle, Microsoft SQL Server), explores their schemas, provides detailed information about tables and columns, shows row counts, and optionally reads sample data.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

Balasai Sigireddy

Balasai Sigireddy

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

0

Monthly active users

4 days ago

Last modified

Share

Apify Actor Version

This Apify Actor connects to various types of databases (SQLite, PostgreSQL, MySQL, Oracle, Microsoft SQL Server), explores their schemas, provides detailed information about tables and columns, shows row counts, optionally reads sample data, and can generate visual schema diagrams.

Supported Databases

Database TypeConnection MethodStatus
SQLiteFile upload or connection string✅ Fully Supported
PostgreSQLConnection string✅ Fully Supported
MySQLConnection string✅ Fully Supported
SQL ServerConnection string✅ Fully Supported
OracleConnection string⚠️ Requires Oracle client

Database Connection Examples

  • SQLite: sqlite:///path/to/database.db or upload .db file
  • PostgreSQL: postgresql://user:password@host:port/database
  • MySQL: mysql://user:password@host:port/database
  • SQL Server: mssql://user:password@host:port/database

Input Parameters

  • db_type: Database type (sqlite, postgresql, mysql, oracle, mssql)
  • connection_string: Database connection string (e.g., 'sqlite:///database.db' or 'postgresql://user:pass@host:port/db'). For SQLite, you can alternatively upload a database file.
  • sqlite_file: Upload a SQLite database file (.db) to explore (only for SQLite databases)
  • tables_to_explore: List of specific table names to explore (optional, explores all if empty)
  • include_sample_data: Whether to include sample data (default: true)
  • max_sample_rows: Maximum number of sample rows per table (default: 10)
  • generate_schema_image: Whether to generate a visual diagram of the database schema (default: false)
  • diagram_type: Type of diagram to generate (mermaid, plantuml, graphviz) - required if generate_schema_image is true
  • output_format: Output format for the diagram (png, svg, pdf) - required if generate_schema_image is true

Output

The Actor outputs structured JSON data to a dataset, containing for each table:

  • Table name
  • Row count
  • Column details (name, type, nullable, default)
  • Sample data (if requested)

If schema image generation is enabled, a visual diagram is also stored in the key-value store.

Example Output Structure

{
"table_name": "users",
"row_count": 5,
"columns": [
{
"name": "id",
"type": "INTEGER",
"nullable": false,
"default": null
},
{
"name": "name",
"type": "TEXT",
"nullable": false,
"default": null
}
],
"sample_data": [
{
"id": 1,
"name": "Alice Johnson",
"email": "alice@example.com"
}
]
}

Schema Visualization

When generate_schema_image is enabled, the Actor generates a visual diagram of your database schema using one of three supported diagram types:

Diagram Types

  • Mermaid: Clean, modern ER diagrams using Mermaid.js
  • PlantUML: Traditional UML entity-relationship diagrams
  • Graphviz: Record-based table representations using DOT language

Output Formats

  • PNG: Raster image format (default)
  • SVG: Scalable vector graphics
  • PDF: Portable document format

The generated diagram includes all explored tables with their column names, data types, and nullability constraints. The image is stored in the Actor's key-value store and can be accessed via the output schema template.

Quick Start

🚀 Try it now: Run on Apify

For SQLite Testing

  1. Download the included dummy.db file from this repository
  2. Go to the Actor page
  3. Upload the dummy.db file as the SQLite file parameter
  4. Run the actor and explore the results!

For Other Databases

  1. Set your database connection parameters
  2. Choose the appropriate database type
  3. Run the actor to explore your database schema

Testing with Dummy Database

A sample SQLite database (dummy.db) is included in the repository for testing purposes. It contains:

  • users table: 5 users with id, name, email, age, created_at
  • products table: 5 products with id, name, price, category, stock
  • orders table: 20 sample orders linking users and products

You can upload this file when testing the Actor with SQLite database type.

Local Development

To run the Actor locally:

$apify run

Deploy to Apify

Already Deployed! This actor is live at: https://console.apify.com/actors/OFPqTSGvR8YnLhU5h

Connect Git repository to Apify

If you've created a Git repository for the project, you can easily connect to Apify:

  1. Go to Actor creation page
  2. Click on Link Git Repository button

Push project on your local machine to Apify

You can also deploy the project on your local machine to Apify without the need for the Git repository.

  1. Log in to Apify. You will need to provide your Apify API Token to complete this action.

    $apify login
  2. Deploy your Actor. This command will deploy and build the Actor on the Apify Platform. You can find your newly created Actor under Actors -> My Actors.

    $apify push

Documentation reference

To learn more about Apify and Actors, take a look at the following resources: