
Spring boot : 3.3.5
Java : 21
lib : spring reactive web, r2dbc
db : mysql
DROP DATABASE webflux;
Create DATABASE webflux;
use webflux;
create table member(
id varchar(100) NOT NULL UNIQUE PRIMARY KEY,
pass varchar(100) NOT NULL ,
name varchar(100) NOT NULL ,
create_at DATETIME NOT NULL ,
update_at DATETIME NOT NULL
);
create table board(
id bigint NOT NULL UNIQUE PRIMARY KEY auto_increment ,
title varchar(100) NOT NULL ,
content varchar(100) NOT NULL ,
create_at DATETIME NOT NULL ,
update_at DATETIME NOT NULL
);
create table member_board(
id bigint NOT NULL UNIQUE PRIMARY KEY auto_increment,
member_id varchar(100) NOT NULL ,
board_id bigint NOT NULL ,
FOREIGN KEY (member_id) REFERENCES member (id),
FOREIGN KEY (board_id) REFERENCES board (id)
);
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-webflux'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// r2dbc
implementation "org.springframework.boot:spring-boot-starter-data-r2dbc"
implementation 'io.asyncer:r2dbc-mysql:1.2.0'
testRuntimeOnly 'com.h2database:h2'
testImplementation 'io.r2dbc:r2dbc-h2'
}
spring :
application:
name: webfluxtest
r2dbc:
url: r2dbc:pool:mysql://localhost:3306/webflux
username: root
password: wb6265
logging:
level:
org.springframework.r2dbc.core: debug