feat/catalog 2.0 (#16)

* feat: lazy-load catalog from all dbs

* feat: add interactions
This commit is contained in:
Ted Conbeer 2025-02-25 15:01:58 -07:00 committed by GitHub
commit f05f2009d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 2151 additions and 459 deletions

27
tests/conftest.py Normal file
View file

@ -0,0 +1,27 @@
from __future__ import annotations
from typing import Generator
import pyodbc
import pytest
from harlequin_odbc.adapter import (
HarlequinOdbcAdapter,
HarlequinOdbcConnection,
)
MASTER_DB_CONN = "Driver={ODBC Driver 18 for SQL Server};Server=tcp:localhost,1433;Database=master;Uid=sa;Pwd={for-testing};Encrypt=yes;TrustServerCertificate=yes;Connection Timeout=5;" # noqa: E501
TEST_DB_CONN = "Driver={ODBC Driver 18 for SQL Server};Server=tcp:localhost,1433;Database=test;Uid=sa;Pwd={for-testing};Encrypt=yes;TrustServerCertificate=yes;Connection Timeout=5;" # noqa: E501
@pytest.fixture
def connection() -> Generator[HarlequinOdbcConnection, None, None]:
master_conn = pyodbc.connect(MASTER_DB_CONN, autocommit=True)
cur = master_conn.cursor()
cur.execute("drop database if exists test;")
cur.execute("create database test;")
cur.close()
master_conn.close()
conn = HarlequinOdbcAdapter(conn_str=(TEST_DB_CONN,)).connect()
yield conn
conn.close()