Skip to content

Commit

Permalink
added Trino documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
domnikl committed Apr 22, 2024
1 parent b279cdb commit cbe16b5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ ConnectorX supports retrieving data from Postgres, MsSQL, MySQL, Oracle, SQLite,
* [MySQL](./databases/mysql.md)
* [Oracle](./databases/oracle.md)
* [Postgres](./databases/postgres.md)
* [SQLite](./databases/sqlite.md)
* [SQLite](./databases/sqlite.md)
* [Trino](./databases/trino.md)

36 changes: 36 additions & 0 deletions docs/databases/trino.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Trino

## Postgres Connection

```{hint}
Using `trino+http` as connection protocol disables SSL for the connection. Example: `trino+http://host:port/catalog
Notice that basic auth requires SSL for Trino.
```

```py
import connectorx as cx
conn = 'trino+https://username:password@server:port/catalog' # connection token
query = "SELECT * FROM table" # query string
cx.read_sql(conn, query) # read data from Trino
```

## Trino-Pandas Type Mapping

| Trino Type | Pandas Type | Comment |
| :--------: | :---------------------: | :-----: |
| BOOLEAN | bool, boolean(nullable) | |
| TINYINT | int64, Int64(nullable) | |
| SMALLINT | int64, Int64(nullable) | |
| INT | int64, Int64(nullable) | |
| BIGINT | int64, Int64(nullable) | |
| REAL | float64 | |
| DOUBLE | float64 | |
| DECIMAL | float64 | |
| VARCHAR | object | |
| CHAR | object | |
| DATE | datetime64[ns] | |
| TIME | object | |
| TIMESTAMP | datetime64[ns] | |
| UUID | object | |
| JSON | object | |
| IPADDRESS | object | |

0 comments on commit cbe16b5

Please sign in to comment.