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

> O mecanismo permite importar e exportar dados para o SQLite e oferece suporte a consultas a tabelas do SQLite diretamente no ClickHouse.

# Mecanismo de tabela SQLite

export const CloudNotSupportedBadge = () => {
  return <div className="cloudNotSupportedBadge">
            <div className="cloudNotSupportedIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.5" d="M6.33366 12.6666L12.3739 12.6667C13.6593 12.6667 14.7073 11.6187 14.7073 10.3334C14.7073 9.04804 13.6593 8.00003 12.3739 8.00003C12.3739 8.00003 12.3337 7.66659 12.0003 7.33325M10.667 5.33322C8.00033 2.33325 4.45395 4.78537 4.14195 6.68203C2.55728 6.7627 1.29395 8.06203 1.29395 9.6667C1.29395 11.3234 2.66699 12.6666 4.00033 12.6666" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.5" d="M2.66699 14L12.0003 4.66663" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>

        </div>
            Not supported in ClickHouse Cloud
        </div>;
};

O motor permite importar e exportar dados para o SQLite e oferece suporte a consultas em tabelas do SQLite diretamente do ClickHouse.

<div id="creating-a-table">
  ## Criando uma tabela
</div>

```sql theme={null}
    CREATE TABLE [IF NOT EXISTS] [db.]table_name
    (
        name1 [type1],
        name2 [type2], ...
    ) ENGINE = SQLite('db_path', 'table')
```

**Parâmetros do motor**

* `db_path` — Caminho para o arquivo SQLite que contém um banco de dados.
* `table` — Nome de uma tabela no banco de dados SQLite.

<div id="data-types-support">
  ## Suporte a tipos de dados
</div>

Ao especificar explicitamente os tipos de coluna do ClickHouse na definição da tabela, os tipos a seguir do ClickHouse podem ser interpretados a partir de colunas TEXT do SQLite:

* [Date](/pt-BR/reference/data-types/date), [Date32](/pt-BR/reference/data-types/date32)
* [DateTime](/pt-BR/reference/data-types/datetime), [DateTime64](/pt-BR/reference/data-types/datetime64)
* [UUID](/pt-BR/reference/data-types/uuid)
* [Enum8, Enum16](/pt-BR/reference/data-types/enum)
* [Decimal32, Decimal64, Decimal128, Decimal256](/pt-BR/reference/data-types/decimal)
* [FixedString](/pt-BR/reference/data-types/fixedstring)
* Todos os tipos inteiros ([UInt8, UInt16, UInt32, UInt64, Int8, Int16, Int32, Int64](/pt-BR/reference/data-types/int-uint))
* [Float32, Float64](/pt-BR/reference/data-types/float)

Consulte o [motor de banco de dados SQLite](/pt-BR/reference/engines/database-engines/sqlite#data_types-support) para ver o mapeamento de tipos padrão.

<div id="usage-example">
  ## Exemplo de uso
</div>

Exibe uma consulta que cria a tabela SQLite:

```sql theme={null}
SHOW CREATE TABLE sqlite_db.table2;
```

```text theme={null}
CREATE TABLE SQLite.table2
(
    `col1` Nullable(Int32),
    `col2` Nullable(String)
)
ENGINE = SQLite('sqlite.db','table2');
```

Retorna os dados da tabela:

```sql theme={null}
SELECT * FROM sqlite_db.table2 ORDER BY col1;
```

```text theme={null}
┌─col1─┬─col2──┐
│    1 │ text1 │
│    2 │ text2 │
│    3 │ text3 │
└──────┴───────┘
```

**Veja também**

* motor [SQLite](/pt-BR/reference/engines/database-engines/sqlite)
* função de tabela [sqlite](/pt-BR/reference/functions/table-functions/sqlite)
