--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: poached excerpt: | DuckDB Community Extensions SQL parsing and introspection for IDEs, editors, and developer tools extension: name: poached description: SQL parsing and introspection for IDEs, editors, and developer tools version: 0.2.3 language: C/C++ build: cmake license: MIT requires_toolchains: "python3" excluded_platforms: "windows_amd64;windows_arm64;windows_amd64_mingw" maintainers: - sidequery repo: github: sidequery/poached ref: 2bdb07eabb92b1de546a1eb8e987983a8928c3b6 docs: hello_world: | -- Tokenize SQL for syntax highlighting (with byte positions) SELECT * FROM tokenize_sql('SELECT * FROM users WHERE id = 1'); ┌───────────────┬──────────────────┐ │ byte_position │ category │ ├───────────────┼──────────────────┤ │ 0 │ KEYWORD │ │ 7 │ OPERATOR │ │ 9 │ KEYWORD │ │ 14 │ IDENTIFIER │ │ 20 │ KEYWORD │ │ 26 │ IDENTIFIER │ │ 29 │ OPERATOR │ │ 31 │ NUMERIC_CONSTANT │ └───────────────┴──────────────────┘ -- Validate SQL and get error messages SELECT is_valid_sql('SELECT * FROM'), sql_error_message('SELECT * FROM'); -- Get SELECT column names without executing SELECT * FROM parse_columns('SELECT 1 AS num, ''hello'' AS str', 0); ┌───────────┬──────────┐ │ col_index │ col_name │ ├───────────┼──────────┤ │ 0 │ num │ │ 1 │ str │ └───────────┴──────────┘ -- Extract function calls with type info SELECT * FROM parse_functions('SELECT COUNT(*), UPPER(name) FROM t'); ┌───────────────┬───────────────┐ │ function_name │ function_type │ ├───────────────┼───────────────┤ │ count_star │ aggregate │ │ upper │ scalar │ └───────────────┴───────────────┘ -- Get parsed statement information as JSON SELECT sql_parse_json('SELECT 1 + 2 AS result'); extended_description: | `poached` is a DuckDB extension for SQL parsing and introspection, designed for building IDEs, SQL editors, query analyzers, and developer tools. **Tokenization**: `parse_tokens()` (also available as `tokenize_sql()`) returns tokens with byte positions and categories (KEYWORD, IDENTIFIER, OPERATOR, NUMERIC_CONSTANT, STRING_CONSTANT) for syntax highlighting. Comments are stripped before tokenization. **Validation**: `is_valid_sql()` and `sql_error_message()` for parse error detection and reporting. **Column introspection**: `parse_columns()` returns SELECT column names without executing queries; `parse_column_names()` returns the names as a list. **Query analysis**: `parse_tables()`, `parse_functions()`, `parse_where()` to extract structural information from queries. **JSON output**: `parse_sql_json()` (also available as `sql_parse_json()`) returns parsed statement types and SQL text, or a parse error. For more details, visit the [extension repository](https://github.com/sidequery/poached). extension_star_count: 12 extension_star_count_pretty: 12 extension_download_count: 429 extension_download_count_pretty: 429 image: '/images/community_extensions/social_preview/preview_community_extension_poached.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.4.4 | 1.4.5 | 1.5.5 | 1.5.6 | 2.0.0 | | :--- | :---: | :---: | :---: | :---: | :---: | | Linux AMD64 | ❌ | ❌ | ❌ | ❌ | ✅ | | Linux ARM64 | ❌ | ❌ | ❌ | ❌ | ✅ | | macOS AMD64 | ❌ | ❌ | ❌ | ❌ | ❌ | | macOS ARM64 | ❌ | ❌ | ❌ | ❌ | ✅ | | Windows AMD64 | ❌ | ❌ | ❌ | ❌ | ❌ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ❌ | ❌ | ❌ | ❌ | ✅ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions
| function_name | function_type | description | comment | examples | |----------------------|---------------|-------------|---------|----------| | is_keyword | scalar | NULL | NULL | | | is_valid_sql | scalar | NULL | NULL | | | num_statements | scalar | NULL | NULL | | | parse_column_names | scalar | NULL | NULL | | | parse_columns | table | NULL | NULL | | | parse_function_names | scalar | NULL | NULL | | | parse_functions | table | NULL | NULL | | | parse_keyword_names | scalar | NULL | NULL | | | parse_keywords | table | NULL | NULL | | | parse_sql_json | scalar | NULL | NULL | | | parse_statements | table | NULL | NULL | | | parse_table_names | scalar | NULL | NULL | | | parse_tables | table | NULL | NULL | | | parse_tokens | table | NULL | NULL | | | parse_where | table | NULL | NULL | | | sql_error_message | scalar | NULL | NULL | | | sql_keywords | table | NULL | NULL | | | sql_parse_json | scalar | NULL | NULL | | | sql_strip_comments | scalar | NULL | NULL | | | tokenize_sql | table | NULL | NULL | | ### Overloaded Functions
This extension does not add any function overloads. ### Added Types
This extension does not add any types. ### Added Settings
| name | description | input_type | scope | aliases | typed_value | |----------------|---------------------------------------------------------|------------|--------|---------|-------------| | temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |