Notice
Recent Posts
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Tags more
Archives
관리 메뉴

🐥

Python을 통해 trino 접속 본문

데이터

Python을 통해 trino 접속

•8• 2023. 6. 16. 23:25
from trino.dbapi import connect
from trino.auth import BasicAuthentication


PORT = my_trino_port
CATALOG = "my_trino_catalog"
HOST = "my_trino_host"
SCHEMA = "my_trino_database"

conn = connect(
    user="my_trino_username",
    port=PORT,
    host=HOST,
    catalog=CATALOG,
    schema=SCHEMA,
    auth=BasicAuthentication("my_trino_username", "my_trino_password"),
    http_scheme="https",
    verify = False
)
cur=conn.cursor()

cur.execute("select * \
			from test_table")
rows = cur.fetchall()