> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-vortex-format.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> The URL database engine exposes URL-addressed data as tables.

# URL

The `URL` database engine treats table names as URLs and exposes the data at those URLs as tables. It uses the [`url`](/reference/functions/table-functions/url) table function, which dispatches each URL to the appropriate backend, such as `file`, `s3`, HDFS, Azure Blob Storage, or HTTP.

<h2 id="creating-a-database">
  Creating a database
</h2>

```sql theme={null}
CREATE DATABASE web_data
ENGINE = URL([base_url]);
```

When `base_url` is specified, relative table names are resolved against it. Without a base URL, every table name must be a complete URL.

<h2 id="usage">
  Usage
</h2>

```sql theme={null}
CREATE DATABASE web_data
ENGINE = URL('https://example.com/data/');

SELECT * FROM web_data.`daily.csv`;
```

The database owns no table definitions. Each table is resolved from its URL when it is used, so its schema is inferred from the current data. Table names can also use a full URL, for example `web_data.`s3://bucket/data/events.parquet\`\`.

<h2 id="access-control">
  Access control
</h2>

Creating this database requires `READ` and `WRITE` source grants on `URL`, regardless of [`table_engines_require_grant`](/reference/settings/server-settings/settings/other#table_engines_require_grant). Reading a table also requires a `READ` source grant for the resolved backend; writing requires the matching `WRITE` grant. For example:

```sql theme={null}
GRANT READ, WRITE ON URL TO user_name;
GRANT READ, WRITE ON S3 TO user_name;
```

For a database with a `file://` base URL, a user needs `READ ON FILE`. On ClickHouse server, local files are additionally restricted to [`user_files_path`](/reference/settings/server-settings/settings#user_files_path).

See the [`SOURCES` privileges](/reference/statements/grant#sources) for version and compatibility details.

<h2 id="see-also">
  See also
</h2>

* [`url` table function](/reference/functions/table-functions/url)
* [Filesystem database engine](/reference/engines/database-engines/filesystem)
* [S3 database engine](/reference/engines/database-engines/s3)
