Add RAG basic implementation
This commit is contained in:
@@ -10,6 +10,7 @@ from alembic.migration import MigrationContext
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
|
||||
from estimator.infra.db import Base, normalize_dsn
|
||||
from estimator.infra.db.tables import include_object
|
||||
|
||||
PG = os.getenv("TEST_PG_DSN")
|
||||
|
||||
@@ -26,7 +27,13 @@ async def _diff(dsn: str):
|
||||
async with engine.connect() as conn:
|
||||
|
||||
def run(sync_conn):
|
||||
ctx = MigrationContext.configure(sync_conn, opts={"compare_type": True})
|
||||
ctx = MigrationContext.configure(
|
||||
sync_conn,
|
||||
opts={
|
||||
"compare_type": True,
|
||||
"include_object": lambda *a: include_object(*a, dialect=sync_conn.dialect.name),
|
||||
},
|
||||
)
|
||||
return compare_metadata(ctx, Base.metadata)
|
||||
|
||||
return await conn.run_sync(run)
|
||||
@@ -49,7 +56,7 @@ def _drop_pg(dsn):
|
||||
import psycopg
|
||||
|
||||
with psycopg.connect(dsn, autocommit=True) as c:
|
||||
c.execute("drop table if exists estimate_versions, estimates, alembic_version cascade")
|
||||
c.execute("drop table if exists reference_tasks, estimate_versions, estimates, alembic_version cascade")
|
||||
|
||||
|
||||
@pytest.fixture(params=["sqlite", "postgres"])
|
||||
|
||||
Reference in New Issue
Block a user