crate / cratedb-sqlparse

Parsing utilities to validate and split SQL statements for CrateDB.
Apache License 2.0
4 stars 1 forks source link

Extract metadata from the query into the statement. #36

Closed surister closed 4 weeks ago

surister commented 4 weeks ago

Summary of the changes / Why this is an improvement

Implements extracting metadata using an AstBuilder to enrich a Statement

Currently only gets the schema and table name.

Example:

stmt = sqlparse("SELECT A, B FROM doc.tbl1")[0]

print(stmt.metadata)
# Metadata(schema='doc', table_name='tbl1')

Sets the foundation for more features in the future, like #31 .

Checklist