Skip to content

Commit dd5187b

Browse files
committed
Init
0 parents  commit dd5187b

File tree

7 files changed

+364
-0
lines changed

7 files changed

+364
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.metadata
2+
.settings
3+
.classpath
4+
.project
5+
target
6+
Thumbs.db
7+
*.pdb
8+
*.log
9+
*.log.*
10+
build
11+
bin
12+
.DS_Store
13+
.idea
14+
*.iml
15+
.vscode

README.md

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Start R2DBC
2+
3+
For running unit test, need to :
4+
5+
1. Create a empty postgres database with name 'test' and owner to 'test' with login password 'password'
6+
2. Run sql script file '[sql/postgres/schema-create.sql]'.
7+
3. Run 'mvn test'.
8+
9+
[sql/postgres/schema-create.sql]: https://github.com/start-java/start-r2dbc/blob/master/src/main/resources/sql/postgres/schema.sql
10+
11+
## 1. [R2DBC]
12+
13+
R2DBC > Reactive Relational Database Connectivity
14+
15+
- [r2dbc-spi](https://github.com/r2dbc/r2dbc-spi)
16+
- [r2dbc-spi-test](https://github.com/r2dbc/r2dbc-spi/tree/master/r2dbc-spi-test) - a Technology Compatibility Kit (TCK)
17+
- [r2dbc-client](https://github.com/r2dbc/r2dbc-client)
18+
- Drivers:
19+
- [r2dbc-h2](https://github.com/r2dbc/r2dbc-h2)
20+
- [r2dbc-postgresql](https://github.com/r2dbc/r2dbc-postgresql)
21+
- [r2dbc-mssql](https://github.com/r2dbc/r2dbc-mssql)
22+
- [r2dbc-over-adba](https://github.com/r2dbc/r2dbc-over-adba)
23+
- [r2dbc.github.io](https://github.com/r2dbc/r2dbc.github.io)
24+
- Examples:
25+
- [r2dbc-postgresql example](https://github.com/r2dbc/r2dbc-postgresql/blob/master/src/test/java/io/r2dbc/postgresql/PostgresqlExample.java)
26+
27+
## 2. [spring-data-r2dbc]
28+
29+
- [spring-data-r2dbc](https://github.com/spring-projects/spring-data-r2dbc)
30+
- [spring-data-jdbc/spring-data-relational](https://github.com/spring-projects/spring-data-jdbc/tree/master/spring-data-relational)
31+
- Examples:
32+
- [spring-data-examples/r2dbc](https://github.com/spring-projects/spring-data-examples/tree/master/r2dbc)
33+
34+
## 3. Release Packages
35+
36+
| Date | Name | Version | Description
37+
|----------------|---------------------------|--------------|-------------
38+
| **2018-12-12** | spring-data-r2dbc | **1.0.0.M1** | [link](https://repo.spring.io/milestone/org/springframework/data/spring-data-r2dbc/1.0.0.M1/)
39+
| **2018-11-19** | io.r2dbc:r2dbc-spi | **1.0.0.M6** | ↑ [released](https://r2dbc.io/2018/11/19/r2dbc-1-0-milestone-6-released)
40+
| 2018-11-19 | io.r2dbc:r2dbc-spi | 1.0.0.M6 | ↑
41+
| 2018-11-19 | io.r2dbc:r2dbc-client | 1.0.0.M6 | ↑
42+
| 2018-11-19 | io.r2dbc:r2dbc-postgresql | 1.0.0.M6 | ↑
43+
| 2018-11-19 | io.r2dbc:r2dbc-h2 | 1.0.0.M6 | + new driver
44+
| 2018-11-19 | io.r2dbc:r2dbc-mssql | 1.0.0.M6 | + new driver
45+
| **2018-09-24** | io.r2dbc:r2dbc-spi | **1.0.0.M5** | ↑
46+
| 2018-09-24 | io.r2dbc:r2dbc-client | 1.0.0.M5 | ↑
47+
| 2018-09-24 | io.r2dbc:r2dbc-postgresql | 1.0.0.M5 | ↑
48+
49+
## 4. Maven Repositories
50+
51+
- <https://repo.spring.io/milestone/io/r2dbc>
52+
- <https://repo.spring.io/milestone/org/springframework/data>
53+
- <https://repo.spring.io/snapshot/org/springframework/data/spring-data-r2dbc>
54+
- <https://repo.spring.io/snapshot/org/springframework/data/spring-data-jdbc>
55+
56+
## 5. Ref
57+
58+
- 2018-12-19 spring blog : [Spring Tips: Reactive SQL Data Access with Spring Data R2DBC](https://spring.io/blog/2018/12/19/spring-tips-reactive-sql-data-access-with-spring-data-r2dbc)
59+
- 2018-12-12 spring blog : [Spring Data R2DBC 1.0 M1 released](https://spring.io/blog/2018/12/12/spring-data-r2dbc-1-0-m1-released)
60+
- 2018-10-01 infoQ : [Experimental Reactive Relational Database Connectivity Driver, R2DBC, Announced at SpringOne](https://www.infoq.com/news/2018/10/springone-r2dbc)
61+
- 2018-09-27 spring blog : [The Reactive Revolution at SpringOne Platform 2018 (part 1/N)](https://spring.io/blog/2018/09/27/the-reactive-revolution-at-springone-platform-2018-part-1-n)
62+
- spring-guides : [Accessing Relational Data using JDBC with Spring](https://spring.io/guides/gs/relational-data-access/)
63+
64+
65+
[R2DBC]: https://r2dbc.io
66+
[spring-data-r2dbc]: https://github.com/spring-projects/spring-data-r2dbc

pom.xml

+252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>tech.simter.start.java</groupId>
5+
<artifactId>start-r2dbc</artifactId>
6+
<packaging>jar</packaging>
7+
<version>1.0-SNAPSHOT</version>
8+
<properties>
9+
<java.version>1.8</java.version>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
12+
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
13+
14+
<!-- reactor -->
15+
<reactor.version>3.2.3.RELEASE</reactor.version>
16+
17+
<!-- spring -->
18+
<spring.version>5.1.3.RELEASE</spring.version>
19+
<spring-boot.version>2.1.1.RELEASE</spring-boot.version>
20+
<spring-data.version>2.1.3.RELEASE</spring-data.version>
21+
<spring-data-r2dbc.version>1.0.0.M1</spring-data-r2dbc.version>
22+
<spring-data-jdbc.version>1.1.0.M1</spring-data-jdbc.version>
23+
24+
<!-- r2dbc -->
25+
<r2dbc.version>1.0.0.M6</r2dbc.version>
26+
27+
<!-- test -->
28+
<slf4j.version>1.7.25</slf4j.version>
29+
<junit5.platform.version>1.3.2</junit5.platform.version>
30+
<junit5.jupiter.version>5.3.2</junit5.jupiter.version>
31+
<junit5.vintage.version>5.3.2</junit5.vintage.version>
32+
<mockito.version>2.23.4</mockito.version>
33+
34+
<!-- database -->
35+
<db.database>test</db.database>
36+
<db.host>localhost</db.host>
37+
<db.user>test</db.user>
38+
<db.password>password</db.password>
39+
</properties>
40+
<dependencyManagement>
41+
<dependencies>
42+
<!-- spring -->
43+
<dependency>
44+
<groupId>org.springframework</groupId>
45+
<artifactId>spring-framework-bom</artifactId>
46+
<version>${spring.version}</version>
47+
<type>pom</type>
48+
<scope>import</scope>
49+
</dependency>
50+
<!-- spring boot -->
51+
<dependency>
52+
<groupId>org.springframework.boot</groupId>
53+
<artifactId>spring-boot-dependencies</artifactId>
54+
<version>${spring-boot.version}</version>
55+
<type>pom</type>
56+
<scope>import</scope>
57+
</dependency>
58+
<!-- spring-data-jdbc -->
59+
<dependency>
60+
<groupId>org.springframework.data</groupId>
61+
<artifactId>spring-data-jdbc</artifactId>
62+
<version>${spring-data-jdbc.version}</version>
63+
</dependency>
64+
</dependencies>
65+
</dependencyManagement>
66+
<dependencies>
67+
<dependency>
68+
<groupId>org.springframework.data</groupId>
69+
<artifactId>spring-data-r2dbc</artifactId>
70+
<version>${spring-data-r2dbc.version}</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.springframework.data</groupId>
74+
<artifactId>spring-data-relational</artifactId>
75+
<version>${spring-data-jdbc.version}</version>
76+
</dependency>
77+
<dependency>
78+
<groupId>org.springframework.boot</groupId>
79+
<artifactId>spring-boot-autoconfigure</artifactId>
80+
</dependency>
81+
<dependency>
82+
<groupId>io.r2dbc</groupId>
83+
<artifactId>r2dbc-spi</artifactId>
84+
<version>${r2dbc.version}</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.slf4j</groupId>
88+
<artifactId>slf4j-api</artifactId>
89+
<version>${slf4j.version}</version>
90+
</dependency>
91+
<dependency>
92+
<groupId>org.projectlombok</groupId>
93+
<artifactId>lombok</artifactId>
94+
<version>1.18.4</version>
95+
</dependency>
96+
97+
<!-- test -->
98+
<dependency>
99+
<groupId>org.springframework.boot</groupId>
100+
<artifactId>spring-boot-starter-test</artifactId>
101+
<version>${spring-boot.version}</version>
102+
<scope>test</scope>
103+
</dependency>
104+
<dependency>
105+
<groupId>io.projectreactor</groupId>
106+
<artifactId>reactor-test</artifactId>
107+
<version>${reactor.version}</version>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>ch.qos.logback</groupId>
112+
<artifactId>logback-classic</artifactId>
113+
<version>1.2.3</version>
114+
<scope>test</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>org.slf4j</groupId>
118+
<artifactId>jcl-over-slf4j</artifactId>
119+
<version>${slf4j.version}</version>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>org.junit.jupiter</groupId>
124+
<artifactId>junit-jupiter-api</artifactId>
125+
<version>${junit5.jupiter.version}</version>
126+
<scope>test</scope>
127+
</dependency>
128+
<dependency>
129+
<groupId>org.junit.jupiter</groupId>
130+
<artifactId>junit-jupiter-engine</artifactId>
131+
<version>${junit5.jupiter.version}</version>
132+
<scope>test</scope>
133+
</dependency>
134+
<dependency>
135+
<groupId>org.apiguardian</groupId>
136+
<artifactId>apiguardian-api</artifactId>
137+
<version>1.0.0</version>
138+
<scope>test</scope>
139+
</dependency>
140+
<dependency>
141+
<groupId>org.mockito</groupId>
142+
<artifactId>mockito-core</artifactId>
143+
<version>${mockito.version}</version>
144+
<scope>test</scope>
145+
</dependency>
146+
<dependency>
147+
<groupId>org.mockito</groupId>
148+
<artifactId>mockito-junit-jupiter</artifactId>
149+
<version>${mockito.version}</version>
150+
<scope>test</scope>
151+
</dependency>
152+
</dependencies>
153+
<build>
154+
<resources>
155+
<resource>
156+
<directory>src/main/resources</directory>
157+
<filtering>true</filtering>
158+
</resource>
159+
</resources>
160+
<testResources>
161+
<testResource>
162+
<directory>src/test/resources</directory>
163+
<filtering>true</filtering>
164+
</testResource>
165+
</testResources>
166+
<plugins>
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-compiler-plugin</artifactId>
170+
<version>3.8.0</version>
171+
<configuration>
172+
<source>1.8</source>
173+
<target>1.8</target>
174+
<encoding>UTF-8</encoding>
175+
</configuration>
176+
</plugin>
177+
<plugin>
178+
<groupId>org.apache.maven.plugins</groupId>
179+
<artifactId>maven-dependency-plugin</artifactId>
180+
<version>3.1.1</version>
181+
</plugin>
182+
<plugin>
183+
<groupId>org.apache.maven.plugins</groupId>
184+
<artifactId>maven-surefire-plugin</artifactId>
185+
<version>2.22.1</version>
186+
</plugin>
187+
</plugins>
188+
</build>
189+
<profiles>
190+
<!-- database -->
191+
<profile>
192+
<id>postgres</id>
193+
<activation>
194+
<activeByDefault>true</activeByDefault>
195+
</activation>
196+
<dependencies>
197+
<dependency>
198+
<groupId>io.r2dbc</groupId>
199+
<artifactId>r2dbc-postgresql</artifactId>
200+
<version>${r2dbc.version}</version>
201+
<scope>runtime</scope>
202+
</dependency>
203+
<dependency>
204+
<groupId>org.postgresql</groupId>
205+
<artifactId>postgresql</artifactId>
206+
<version>42.2.5</version>
207+
<scope>runtime</scope>
208+
</dependency>
209+
</dependencies>
210+
</profile>
211+
<profile>
212+
<id>h2</id>
213+
<activation>
214+
<activeByDefault>false</activeByDefault>
215+
</activation>
216+
<dependencies>
217+
<dependency>
218+
<groupId>io.r2dbc</groupId>
219+
<artifactId>r2dbc-h2</artifactId>
220+
<version>${r2dbc.version}</version>
221+
<scope>runtime</scope>
222+
</dependency>
223+
<dependency>
224+
<groupId>com.h2database</groupId>
225+
<artifactId>h2</artifactId>
226+
<version>1.4.197</version>
227+
<scope>runtime</scope>
228+
</dependency>
229+
</dependencies>
230+
</profile>
231+
<profile>
232+
<id>mssql</id>
233+
<activation>
234+
<activeByDefault>false</activeByDefault>
235+
</activation>
236+
<dependencies>
237+
<dependency>
238+
<groupId>io.r2dbc</groupId>
239+
<artifactId>r2dbc-mssql</artifactId>
240+
<version>${r2dbc.version}</version>
241+
<scope>runtime</scope>
242+
</dependency>
243+
<dependency>
244+
<groupId>com.microsoft.sqlserver</groupId>
245+
<artifactId>mssql-jdbc</artifactId>
246+
<version>7.1.3.jre8-preview</version>
247+
<scope>runtime</scope>
248+
</dependency>
249+
</dependencies>
250+
</profile>
251+
</profiles>
252+
</project>

src/main/resources/empty.txt

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
drop table if exists dream;
2+
create table dream (
3+
id int primary key,
4+
name varchar(50) not null,
5+
create_on timestamp
6+
);

src/test/resources/application.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
spring:
2+
main:
3+
banner-mode: 'OFF'
4+
logging:
5+
#file: target/test.log
6+
level: # one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF
7+
root: ERROR
8+
tech.simter.start.java.r2dbc: WARN
9+
10+
#org.springframework: WARN
11+
#org.springframework.boot: WARN
12+
13+
#---- r2dbc ----#
14+
io.r2dbc: WARN
15+
io.r2dbc.postgresql.client.ReactorNettyClient: WARN # debug to show postgres request and Response
16+
org.springframework.data.r2dbc: WARN
17+
org.springframework.data.r2dbc.function.DefaultDatabaseClient: DEBUG # debug to show sql

src/test/resources/logback-test.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<include resource="org/springframework/boot/logging/logback/base.xml"/>
4+
<!-- trace < debug < info < warn < error -->
5+
<root level="warn"/>
6+
7+
<logger name="tech.simter.start.java.r2dbc" level="warn"/>
8+
</configuration>

0 commit comments

Comments
 (0)