sql-tables

Read and write SQL tables from Python using SQLAlchemy and pandas.

Updated Jan 20, 2026
One-click install
npx skills add https://github.com/BLSQ/mcp_servers --skill sql-tables
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-tables
Source: https://github.com/BLSQ/mcp_servers/tree/main/.claude/skills/sql-tables
Command: npx skills add https://github.com/BLSQ/mcp_servers --skill sql-tables

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables Python developers to read from and write to SQL tables directly from code, eliminating repetitive boilerplate and enabling clean data workflows in pipelines and notebooks.

Core Features & Use Cases

  • Read: execute SQL queries and load results into pandas DataFrames with proper type handling.
  • Write: safely persist DataFrames to database tables using explicit schema definitions and best practices for upserts.
  • Use Case: Enrich a data pipeline by reading source tables, transforming in DataFrames, and writing results to a target table with minimal boilerplate.

Quick Start

Connect to your database using a URL from the environment or the OpenHEXA SDK, then read and write a table with Python:

  • Read a table: df = pd.read_sql('SELECT * FROM my_table LIMIT 1000', engine)
  • Write a table: df.to_sql(name='my_table_copy', con=engine, if_exists='replace', index=False)

Frequently Asked Questions about sql-tables

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read SQL tables into pandas DataFrames in Python?

To read SQL tables into pandas DataFrames, execute SQL queries using SQLAlchemy and pandas, which loads results with proper type handling. This streamlines data workflows in pipelines and notebooks by eliminating repetitive boilerplate.

What is the best way to write pandas DataFrames to SQL tables with explicit types?

The best way to write pandas DataFrames to SQL tables is using explicit schema definitions for safe persistence. This approach applies best practices for upserts, ensuring data is safely written to PostgreSQL or compatible engines.

Do I need SQLAlchemy to manage SQL tables in Python data pipelines?

Yes, you need SQLAlchemy to manage SQL tables in Python data pipelines, along with pandas. A database URL must also be provided via environment variables or the OpenHEXA SDK to establish the connection.

Can I safely upsert data in PostgreSQL using Python without writing boilerplate?

You can safely upsert data in PostgreSQL using Python by leveraging built-in operations that handle upserts automatically. This eliminates repetitive boilerplate and ensures data integrity when updating existing records.

How does reading and writing SQL tables work in notebook workflows?

Reading and writing SQL tables in notebook workflows works by executing SQL queries to load data into pandas DataFrames, transforming the data, and then writing results to target tables. This supports clean data workflows with minimal code.

How do I ensure a SQL table exists before writing a DataFrame in Python?

To ensure a SQL table exists before writing a DataFrame in Python, use built-in operations designed to verify table existence. This allows safe persistence of DataFrames to database tables using explicit schema definitions.