adapters¶
어댑터 패턴 객체들이 정되된 모듈입니다.
orm¶
ORM 어댑터 모듈
-
class
AbstractSession¶ 세션의 일반적인 작업(commit, rollback) 을 추상화한 클래스.
-
abstract
commit()¶ 트랜잭션을 커밋합니다.
- Return type
None
-
abstract
-
SessionMaker¶ Session 팩토리 타입.
alias of Callable[[], sqlalchemy.orm.session.Session]
-
clear_mappers()¶ ORM 매핑을 초기화 합니다.
- Return type
None
-
get_scoped_session(engine)¶ with...문으로 자동 리소스가 반환되는 세션을 리턴합니다.Example:
with get_scoped_session() as db: batches = db.query(Batch).all() ...
- Parameters
engine (
Engine) – Engine.- Return type
Callable[[],AbstractContextManager[Session]]
-
get_session()¶ 기본설정으로 SqlAlchemy Session 팩토리를 만듭니다.
- Return type
Callable[[],Session]
-
init_engine(meta, url, connect_args=None, poolclass=None, show_log=False, isolation_level=None, drop_all=False)¶ ORM Engine을 초기화 합니다.
TODO: 상세 설명 추가.
- Return type
-
start_mappers(use_exist=True)¶ 도메인 객체들을 SqlAlchemy ORM 매퍼에 등록합니다.
- Return type
MetaData
repository¶
레포지터리 패턴 구현.
-
class
AbstractRepository¶ Bases:
abc.ABC,contextlib.ContextDecoratorRepository 패턴의 추상 인터페이스 입니다.
-
abstract
add(batch)¶ 레포지터리에
Batch객체를 추가합니다.- Return type
None
-
abstract
clear()¶ 레포지터리 내의 모든 엔티티 데이터를 지웁니다.
- Return type
None
-
close()¶ 레포지터리와 연결된 저장소 객체를 종료합니다.
- Return type
None
-
abstract
delete(item)¶ 레포지터리에서
Batch또는OrdereLine객체를 삭제합니다.- Return type
None
-
abstract
-
class
SqlAlchemyRepository(session)¶ Bases:
app.adapters.repository.AbstractRepositorySqlAlchemy ORM을 저장소로 하는
AbstractRepository구현입니다.-
add(batch)¶ 레포지터리에
Batch객체를 추가합니다.- Return type
None
-
clear()¶ 레포지터리 내의 모든 엔티티 데이터를 지웁니다.
- Return type
None
-
close()¶ 레포지터리와 연결된 저장소 객체를 종료합니다.
- Return type
None
-
delete(item)¶ 레포지터리에서
Batch또는OrdereLine객체를 삭제합니다.- Return type
None
-