Skip to content

Commit db69633

Browse files
authored
Remove unused begin, is_active code (#11)
* Remove unuse uow code.. * Version patch.. * Add installation guide.. * Fix same env python poetry..
1 parent ce11765 commit db69633

5 files changed

Lines changed: 48 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ on:
77

88
jobs:
99
deploy:
10-
runs-on: ubuntu-latest
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
python-version: [ 3.8 ]
14+
poetry-version: [ 1.1.11 ]
15+
os: [ ubuntu-latest ]
1116
steps:
1217
- uses: rymndhng/release-on-push-action@master
1318
env:

README.ko.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,26 @@ Python Micro Framework Data는 [Falcon](https://falcon.readthedocs.io/en/stable/
1818

1919

2020

21+
## How to install (rdb)
22+
23+
Python Micro Framework Data 라이브러리를 관계형 데이터베이스용도로 설치하는 경우 아래의 명령어를 입력하십시오.
24+
25+
```shell
26+
$ pip install python-mf-data[rdb]
27+
```
28+
29+
```shell
30+
$ poetry add "python-mf-data[rdb]"
31+
```
32+
33+
extra 옵션에 반드시 rdb를 입력해야 SQLAlchemy 등의 하위 디펜던시가 설치됩니다.
34+
35+
36+
37+
<br />
38+
39+
40+
2141
## Connection Example (rdb)
2242

2343
아래의 코드는 pymfdata에 있는 SQLAlchemy의 커넥션을 생성하는 예제입니다.
@@ -207,4 +227,4 @@ class MemoUseCase:
207227

208228
작업 단위 패턴 또한 비동기, 동기에 따라 클래스가 별도로 구현되어 있습니다. 생성한 커넥션에 맞춰 사용하시면 됩니다.
209229

210-
이렇게 만들어진 작업 단위 클래스는 애플리케이션의 비즈니스 로직을 정의할 ***UseCase*** 클래스에 담아 사용할 수 있습니다. 사실상 비즈니스 로직에서 트랜잭션이 필요로 하는 경우의 코드이기 때문에 작업 단위 패턴에 있는 메서드에 ```transactional``` 데코레이터를 사용합니다.
230+
이렇게 만들어진 작업 단위 클래스는 애플리케이션의 비즈니스 로직을 정의할 ***UseCase*** 클래스에 담아 사용할 수 있습니다. 사실상 비즈니스 로직에서 트랜잭션이 필요로 하는 경우의 코드이기 때문에 작업 단위 패턴에 있는 메서드에 ```transactional``` 데코레이터를 사용하여 트랜잭션을 처리할 수 있습니다.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,26 @@ Currently, this library is **still under development**. The only stable database
2222

2323

2424

25+
## How to install (rdb)
26+
27+
If you are installing the Python Micro Framework Data library for a relational database, enter the command below.
28+
29+
```shell
30+
$ pip install python-mf-data[rdb]
31+
```
32+
33+
```shell
34+
$ poetry add "python-mf-data[rdb]"
35+
```
36+
37+
You must enter **rdb** in the extra option to install sub-dependencies such as SQLAlchemy.
38+
39+
40+
41+
<br />
42+
43+
44+
2545
## Connection Example (rdb)
2646

2747
If you want to create a connection in SQLAlchemy using ```pymfdata```, please follow the instructions below.

pymfdata/rdb/command.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,12 @@ async def __aenter__(self):
1717
async def __aexit__(self, exc_type: Optional[Type[Exception]], exc_val: Optional[Exception], traceback):
1818
await self.session.close()
1919

20-
def begin(self, **kwargs):
21-
self.session.begin(**kwargs)
22-
2320
async def commit(self):
2421
await self.session.commit()
2522

2623
async def flush(self):
2724
await self.session.flush()
2825

29-
def is_active(self) -> bool:
30-
return self.session.is_active
31-
3226
async def refresh(self, item):
3327
await self.session.refresh(item)
3428

@@ -47,17 +41,11 @@ def __enter__(self):
4741
def __exit__(self, exc_type: Optional[Type[Exception]], exc_val: Optional[Exception], traceback):
4842
self.session.close()
4943

50-
def begin(self, **kwargs):
51-
self.session.begin(**kwargs)
52-
5344
def commit(self):
5445
self.session.commit()
5546

5647
def flush(self):
5748
self.session.flush()
5849

59-
def is_active(self) -> bool:
60-
return self.session.is_active
61-
6250
def rollback(self):
6351
self.session.rollback()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "python-mf-data"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
description = "Python Micro Framework Data"
55
authors = ["Neon K.I.D <contact@neonkid.xyz>"]
66
packages = [

0 commit comments

Comments
 (0)