@@ -0,0 +1,629 @@
+#!/usr/bin/env python3%0Afrom ietf.utility.environment import get_db_path%0Afrom ietf.sql.base import Base%0Afrom ietf.sql.rfc import Rfc%0Afrom sqlalchemy import create_engine%0Afrom sqlalchemy.orm import sessionmaker%0A%0A%0Adef get_db_session():%0A    %22%22%22Return a DB session.%22%22%22%0A    db_path = get_db_path()%0A    engine = create_engine(%22sqlite:///%7B%7D%22.format(db_path))%0A    Base.metadata.create_all(engine, checkfirst=True)%0A    session = sessionmaker(bind=engine)()%0A    return session%0A%0A%0Adef query_rfc_by_id(session, number):%0A    row = session.query(Rfc).%5C%0A                  filter(Rfc.id == number).%5C%0A                  one_or_none()%0A    return row%0A

Add ietf.utility.query