{"categories":[{"label":"Database","url":"https://skillfed.io/packages/category/database"}],"enrichment":{"capability":"Parses SQL queries using sqlglot and extracts metadata: column names, table names, aliases, query types, and values from INSERT statements.","skillfed_tags":["sql-parsing","metadata-extraction","query-analysis"],"use_cases":["Extract column and table dependencies from queries to build data lineage or impact analysis tools","Validate query structure and detect referenced tables before execution in data pipelines","Resolve aliases and normalize queries for logging, auditing, or query rewriting systems","Analyze INSERT statements to map input values to their target columns programmatically","Build IDE or documentation tools that need to understand query structure without parsing SQL yourself"],"what_it_does":"sql-metadata wraps sqlglot to parse SQL queries and extract structural metadata without executing them. It identifies columns, tables, aliases, query types (SELECT, INSERT, UPDATE, DELETE, etc.), and values from INSERT statements. The parser automatically resolves column aliases back to their source columns, table aliases to their actual table names, and subquery aliases to their definitions\u2014useful when you need to understand query dependencies without running the query itself.\n\nThe package supports MySQL, PostgreSQL, SQLite, MSSQL, and Apache Hive syntax. It provides both raw token extraction and semantic analysis: you can get columns grouped by their clause (SELECT, WHERE, JOIN, ORDER BY, etc.), output column names preserving aliases, WITH clause definitions, and limit/offset values. It raises InvalidQueryDefinition for structurally invalid SQL, making error handling straightforward.","worth_installing":"Yes. Low install friction, active maintenance, MIT license, no known vulnerabilities, and a single well-maintained dependency. Install it if you need to extract or analyze SQL query structure\u2014it handles the parsing complexity so you don't have to."},"id":"sql-metadata","links":{"html":"https://skillfed.io/packages/sql-metadata","md":"https://skillfed.io/packages/sql-metadata.md","pypi":"https://pypi.org/project/sql-metadata/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-30","license_spdx":null,"license_treatment":"permissive","name":"sql-metadata","python_support":"supports_current","summary":"Uses sqlglot to parse SQL queries and extract metadata"},"popularity":{"monthly_downloads":6799628,"position":1845,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"3.0.1"}
