Readme 수정 중
This commit is contained in:
78
README.md
78
README.md
@@ -1,3 +1,5 @@
|
||||
# KOREA-RESEARCH
|
||||
|
||||
```
|
||||
┬─┐┌─┐┌─┐┬ ┬┌─┐┬ ┌─┐
|
||||
├┬┘├┤ │ └┬┘│ │ ├┤
|
||||
@@ -27,6 +29,7 @@ of this license document, but changing it is not allowed.
|
||||
|
||||
* JDK 17+
|
||||
* Maven
|
||||
* PostgreSQL
|
||||
|
||||
## Structure
|
||||
|
||||
@@ -76,14 +79,7 @@ recycle 의 demo 가 궁금하다면 아래 URL 에서 확인 해주세요.
|
||||
| VM 변수 | 설명 | 설정 값 | 필수여부 |
|
||||
|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------|------|
|
||||
| -Dspring.profiles.active | Spring active 프로파일 | local, dev, prod | Y |
|
||||
| **-Dspring.datasource.driver-class-name** (2023-03-25 추가) | JDBC Driver. 없다면 JDBC URL을 기준으로 JPA가 판단한다. | jdbc 드라이버 | Y |
|
||||
| **-Dspring.datasource.url** (2023-03-25 추가) | JDBC URL | jdbc url | N |
|
||||
| **-Dspring.datasource.username** (2023-03-25 추가) | DB Username | DB 사용자 | Y |
|
||||
| **-Dspring.datasource.password** (2023-03-25 추가) | DB Password | DB 패스워드 | Y |
|
||||
| -Dapp.initData.core | 어플리케이션 초기 구동에 필요한 필수 데이터 생성여부 | true, false | N |
|
||||
| -Dspring.jpa.hibernate.ddl-auto | JPA DDL 옵션 | update, create 등등 | Y |
|
||||
| -Dspring.jpa.properties.hibernate.show_sql | JPA SQL 로그 보이기 | true, false | N |
|
||||
| -Dlogging.level.org.hibernate.orm.jdbc.bind | JPA 파라미터 바인딩 로그 보이기 | trace (로그보임), info(숨기기) | N |
|
||||
| -Dpath.upload.public | 파일 업로드 경로 | 기본값 (~/upload/public) | N |
|
||||
| -Dpath.upload.tmpdir | 임시 파일 업로드 경로 | 기본값 (~/upload/tmpdir) | N |
|
||||
| -Dlogging.file.path | 로그 파일 생성 경로 | 기본값 (~/logs) | N |
|
||||
@@ -92,77 +88,39 @@ recycle 의 demo 가 궁금하다면 아래 URL 에서 확인 해주세요.
|
||||
| -Dcom.amazonaws.sdk.disableEc2Metadata | aws 모듈의 ec2 metadata 전송 끄기 | true | N |
|
||||
| **-Dserver.port** (2023-03-25 추가) | 서버 포트 (없다면 기본 8080) | 원하는 port | N |
|
||||
| **-Dserver.forward-headers-strategy** (2023-03-25 추가) | 프록시 서버(nginx, apache)에 정의된 `X-Forward-For`, `X-Forwarded-Proto` 설정값을 이용하려면 `native` 로 설정해주면 된다. (내장 컨테이너를 사용하는 경우에만 유효) | `native` | N |
|
||||
| **-Dspring.datasource.driver-class-name** (2023-03-25 추가) | JDBC Driver. 없다면 JDBC URL을 기준으로 JPA가 판단한다. | jdbc 드라이버 | Y |
|
||||
| **-Dspring.datasource.url** (2023-03-25 추가) | JDBC URL | jdbc url | N |
|
||||
| **-Dspring.datasource.username** (2023-03-25 추가) | DB Username | DB 사용자 | Y |
|
||||
| **-Dspring.datasource.password** (2023-03-25 추가) | DB Password | DB 패스워드 | Y |
|
||||
|
||||
|
||||
### VM Options 예시
|
||||
#### `admin`, `front`, `api` 모두 사용가능합니다.
|
||||
```
|
||||
-Dspring.profiles.active=local
|
||||
-Dapp.initData.core=false
|
||||
-Dspring.jpa.hibernate.ddl-auto=update
|
||||
-Dfile.encoding=UTF-8
|
||||
-Djava.net.preferIPv4Stack=true
|
||||
-Dcom.amazonaws.sdk.disableEc2Metadata=true
|
||||
-Dspring.jpa.properties.hibernate.show_sql=true
|
||||
-Dlogging.level.org.hibernate.orm.jdbc.bind=info
|
||||
-Dserver.port=8080
|
||||
-Dserver.forward-headers-strategy=native
|
||||
-Dlogging.level.org.springframework.security=DEBUG
|
||||
-Dspring.datasource.url=jdbc:h2:~/h2/app-h2;AUTO_SERVER=TRUE
|
||||
-Dspring.datasource.username=sa
|
||||
-Dspring.datasource.password=
|
||||
-Dspring.datasource.driver-class-name=org.postgresql.Driver
|
||||
-Dspring.datasource.url=jdbc:postgresql://<DB_HOST>:5432/<DB_NAME>
|
||||
-Dspring.datasource.username=<DB_USERNAME>
|
||||
-Dspring.datasource.password=<DB_PASSWORD>
|
||||
```
|
||||
|
||||
## JDBC 및 데이터 핸들링 구성 옵션
|
||||
|
||||
### JDBC 연결 설정
|
||||
|
||||
스프링부트의 JDBC 설정 방식을 그대로 이용한다. JDBC 연결을 맺을 DB Vendor 와 JNDI 이용여부 등은 프로젝트 상황에 맞게 설정하면 된다.
|
||||
|
||||
recycle 은 `H2`를 기본으로 탑재하고 있다. `H2` 를 이용하면 로컬 개발환경에서 아래와 같은 장점을 얻는다.
|
||||
|
||||
* 설치 과정이 필요없다. (Maven dependency 에 기술되어 각자 환경에 이미 탑재됨)
|
||||
* 가볍고 빠르며 JDBC API 를 지원하는 오픈소스이다.
|
||||
* ANSI SQL 을 지원하기에 범용성이 뛰어남.
|
||||
|
||||
이 프로젝트는 PostgreSQL을 사용하며,
|
||||
JDBC 연결은 위 VM Options에 포함된 아래 설정을 기준으로 동작합니다.
|
||||
```
|
||||
-Dspring.datasource.url=jdbc:h2:~/h2/app-h2;AUTO_SERVER=TRUE
|
||||
-Dspring.datasource.username=sa
|
||||
-Dspring.datasource.password=
|
||||
-Dspring.datasource.driver-class-name=org.postgresql.Driver
|
||||
-Dspring.datasource.url=jdbc:postgresql://<DB_HOST>:5432/<DB_NAME>
|
||||
-Dspring.datasource.username=<DB_USERNAME>
|
||||
-Dspring.datasource.password=<DB_PASSWORD>
|
||||
```
|
||||
|
||||
recycle 이 구동되면서 사용자 홈디렉토리에 밑에 /h2/app-h2.mv 파일을 생성합니다. 생성된 파일을 db 클라이언트 툴에서 접속하는 법은
|
||||
이 [문서](https://javanitto.tistory.com/37) 를 참고하세요.
|
||||
|
||||
⚡️ recycle 은 로컬 개발 환경에서 각자의 DB를 이용한 작업을 지향합니다. 테이블과 데이터를 마음대로 삭제/추가하며 개발할 수 있고, 개발/스테이징/운영 환경 같은 공용 공간에 필요한 정보만 커밋할
|
||||
수 있기
|
||||
때문입니다 : )
|
||||
|
||||
### ddl-auto
|
||||
|
||||
```shell
|
||||
-Dspring.jpa.hibernate.ddl-auto=update # update | create | none | validate
|
||||
```
|
||||
|
||||
**JPA**가 ddl 을 다루는 방식을 정의한다. 엔티티 변경이 많은 개발 시점에는 `update`, `create`를,
|
||||
엔티티 혹은 데이터가 함부로 변경되서는 안되는 운영 환경에서는 `none`, `validate` 등을 지정해준다. (
|
||||
참고: [ddl-auto 옵션 설명](https://smpark1020.tistory.com/140?category=857916))
|
||||
|
||||
### show_sql
|
||||
|
||||
```shell
|
||||
-Dspring.jpa.properties.hibernate.show_sql=true # true | false
|
||||
```
|
||||
|
||||
JPA SQL 로그 보이기 여부
|
||||
|
||||
### descriptor.sql
|
||||
|
||||
```shell
|
||||
-Dlogging.level.org.hibernate.orm.jdbc.bind=trace # trace | info | debug and etc
|
||||
```
|
||||
|
||||
JPA 파라미터 바인딩 로그 보이기. trace 일 때 where 조건절 등 바인딩된 파라미터 정보 확인이 가능.
|
||||
|
||||
### app.initData.core
|
||||
|
||||
```shell
|
||||
|
||||
Reference in New Issue
Block a user