Add missing function protocol

This commit is contained in:
Blargian 2024-06-25 20:33:24 +02:00
parent 81b2cad083
commit 818867d1fc
2 changed files with 35 additions and 0 deletions

View File

@ -818,6 +818,40 @@ The same as above, but including query string and fragment.
Example: `/top/news.html?page=2#comments`. Example: `/top/news.html?page=2#comments`.
### protocol
Extracts the protocol from a URL.
**Syntax**
```sql
protocol(url)
```
**Arguments**
- `url` — URL to extract protocol from. [String](../data-types/string.md).
**Returned value**
- Protocol, or an empty string if it cannot be determined. [String](../data-types/string.md).
**Example**
Query:
```sql
SELECT protocol('https://clickhouse.com/');
```
Result:
```response
┌─protocol('https://clickhouse.com/')─┐
│ https │
└─────────────────────────────────────┘
```
### queryString ### queryString
Returns the query string without the initial question mark, `#` and everything after `#`. Returns the query string without the initial question mark, `#` and everything after `#`.

View File

@ -2257,6 +2257,7 @@ proleptic
prometheus prometheus
proportionsZTest proportionsZTest
proto proto
protocol
protobuf protobuf
protobufsingle protobufsingle
proxied proxied