sqlglot-upgrade

Update SQLFrame for new sqlglot versions, fixing tests and migrating expression classes.

528|25|Updated May 17, 2024
One-click install
npx skills add https://github.com/eakmanrq/sqlframe --skill sqlglot-upgrade
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlglot-upgrade
Source: https://github.com/eakmanrq/sqlframe/tree/main/.claude/skills/sqlglot-upgrade
Command: npx skills add https://github.com/eakmanrq/sqlframe --skill sqlglot-upgrade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill guides users through the process of updating SQLFrame to be compatible with new versions of the sqlglot library, ensuring smooth transitions and leveraging new features.

Core Features & Use Cases

  • Dependency Management: Assists in updating the sqlglot version in setup.py.
  • API Change Detection: Helps identify and adapt to API removals or changes within sqlglot.
  • Code Migration: Provides patterns for migrating from older function invocation methods to new sqlglot expression classes.
  • Use Case: When a new sqlglot release is out, use this Skill to systematically update SQLFrame's codebase, fix broken tests, and adopt new expression classes for cleaner, more efficient SQL transpilation.

Quick Start

Follow the steps outlined in this skill to update the sqlglot dependency and adapt the codebase.

Frequently Asked Questions about sqlglot-upgrade

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

FAQPage Schema
How do I update SQLFrame to be compatible with a new sqlglot version?

To update SQLFrame for a new sqlglot version, follow a systematic process: update the dependency in setup.py, identify API removals, migrate from invoke_anonymous_function to new sqlglot expression classes, and fix resulting test failures.

What does migrating from invoke_anonymous_function to sqlglot expression classes involve?

Migrating from invoke_anonymous_function to sqlglot expression classes involves replacing older function invocation methods with newer expression classes to achieve cleaner, more efficient SQL transpilation and remove dialect-specific workarounds.

How do I handle API removals and changes when upgrading sqlglot dependencies?

Handling sqlglot API removals during an upgrade requires detecting the removed APIs in your codebase, adapting the affected function calls to use the updated sqlglot expression classes, and running tests to verify the dependency migration.

When should I remove dialect-specific workarounds during a sqlglot code migration?

You should remove dialect-specific workarounds during a sqlglot code migration when new expression classes are discovered that natively support the required SQL transpilation, allowing you to replace custom logic with standard library features.

Does this sqlglot upgrade process require fixing broken tests after updating setup.py?

Yes, the sqlglot upgrade process requires fixing broken tests after updating setup.py, as adapting the codebase to API changes and migrating to new expression classes often causes test failures that must be resolved to ensure a smooth transition.

What is the best way to discover new expression classes after a sqlglot upgrade?

The best way to discover new sqlglot expression classes after an upgrade is to systematically review the updated library's API surface, identify classes that replace invoke_anonymous_function, and integrate them to eliminate obsolete dialect-specific workarounds.