--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: url_tools excerpt: | DuckDB Community Extensions A DuckDB extension for URL analytics on messy event logs. extension: name: url_tools description: A DuckDB extension for URL analytics on messy event logs. version: 0.1.0 language: C++ build: cmake license: MIT excluded_platforms: "windows_amd64_mingw" maintainers: - Flamefork repo: github: Flamefork/duckdb-url-tools ref: 38e175892c8778d8eb02e04307b041d3fad1cf2d docs: hello_world: | INSTALL url_tools FROM community; LOAD url_tools; SELECT url_components('https://example.com:8443/path?utm_source=duckdb&id=1&id=2#top'); -- {'scheme': https, 'host': example.com, 'port': 8443, 'path': /path, 'query': 'utm_source=duckdb&id=1&id=2', 'fragment': top} -- Attribution: UTM tags in any key case, also from a single-page-app fragment SELECT query_params('https://shop.com/#/cart?UTM_Source=push&utm_medium=app', 'last', input := 'loose', query_keys := 'lower_case'); -- {utm_source=push, utm_medium=app} -- Grouping by site: subdomains are one site SELECT url_domain('https://m.ozon.ru/p/1'), url_domain('https://shop.example.co.uk/'); -- ozon.ru, example.co.uk extended_description: | `url_tools` does URL analytics on messy event logs. In event and marketing analytics, a URL and its query parameters are dimensions: you attribute events by UTM tags, click ids, deeplinks, the referrer and the landing page, and you group them by site and page. The extension parses with [ada](https://github.com/ada-url/ada), the WHATWG-compliant URL parser. Each function is total over its input: a junk value gives `NULL` or an empty map, never an error, so one bad value cannot fail a full scan. **Functions** - Parse a URL: `url_components` (the WHATWG components as a `STRUCT`, the query raw or parsed into a `MAP`), `url_scheme`, `url_host`, `url_port`, `url_path`, `url_query`, `url_fragment`, and `url_domain` (the registrable domain from a compiled-in Public Suffix List). - Transform a URL: `url_normalize` (the canonical WHATWG form, or a reference resolved against a base URL), `url_origin`. - Extract query parameters: `query_params` (a `MAP` from a URL, a query string or a loose marketing string) and `query_param` (the value of one key), with the case variants of a key optionally read as one key. - The `decode` option returns URL text as WHATWG serializes it, as a readable IRI, or fully decoded. **Stability.** The SQL API can change while the version is `0.x`. **Maintenance** is best-effort, by one maintainer. Give feedback and contributions through GitHub. Full documentation: https://github.com/Flamefork/duckdb-url-tools#readme extension_star_count: 0 extension_star_count_pretty: 0 extension_download_count: 46 extension_download_count_pretty: 46 image: '/images/community_extensions/social_preview/preview_community_extension_url_tools.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.5.5 | 1.5.6 | 2.0.0 | 2.0.1 | | :--- | :---: | :---: | :---: | :---: | | 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 | |----------------|---------------|-------------|---------|----------| | query_param | scalar | NULL | NULL | | | query_params | scalar | NULL | NULL | | | url_components | scalar | NULL | NULL | | | url_domain | scalar | NULL | NULL | | | url_fragment | scalar | NULL | NULL | | | url_host | scalar | NULL | NULL | | | url_normalize | scalar | NULL | NULL | | | url_origin | scalar | NULL | NULL | | | url_path | scalar | NULL | NULL | | | url_port | scalar | NULL | NULL | | | url_query | scalar | NULL | NULL | | | url_scheme | scalar | NULL | NULL | | ### Overloaded Functions This extension does not add any function overloads. ### Added Types | type_name | type_size | logical_type | type_category | internal | |-----------|----------:|--------------|---------------|----------| | VARCHAR | 16 | VARCHAR | STRING | true | ### 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 |