Skip to content

Commit 5ad08a0

Browse files
committed
refactor group name and artifact name
1 parent 1699374 commit 5ad08a0

File tree

2 files changed

+29
-35
lines changed

2 files changed

+29
-35
lines changed

README.md

+20-26
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# PostgreSQL R2DBC Driver [![Java CI with Maven](https://github.com/pgjdbc/r2dbc-postgresql/workflows/Java%20CI%20with%20Maven/badge.svg?branch=main)](https://github.com/pgjdbc/r2dbc-postgresql/actions?query=workflow%3A%22Java+CI+with+Maven%22+branch%3Amain) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.postgresql/r2dbc-postgresql/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.postgresql/r2dbc-postgresql)
1+
# GaussDB R2DBC Driver
22

3-
This project contains the [PostgreSQL][p] implementation of the [R2DBC SPI][r]. This implementation is not intended to be used directly, but rather to be used as the backing implementation for a humane client library to delegate to.
3+
This project contains the [GaussDB][p] implementation of the [R2DBC SPI][r]. This implementation is not intended to be used directly, but rather to be used as the backing implementation for a humane client library to delegate to.
44

55
This driver provides the following features:
66

77
* Implements R2DBC 1.0
8-
* Login with username/password (MD5, SASL/SCRAM) or implicit trust
8+
* Login with username/password
99
* Supports credential rotation by providing `Supplier<String>` or `Publisher<String>`
10-
* SCRAM authentication
1110
* Unix Domain Socket transport
1211
* Connection Fail-over supporting multiple hosts
1312
* TLS
@@ -18,14 +17,13 @@ This driver provides the following features:
1817
* Execution of prepared statements with bindings
1918
* Execution of batch statements without bindings
2019
* Read and write support for a majority of data types (see [Data Type Mapping](#data-type-mapping) for details)
21-
* Fetching of `REFCURSOR` using `io.r2dbc.postgresql.api.RefCursor`
22-
* Extension points to register `Codec`s to handle additional PostgreSQL data types
20+
* Extension points to register `Codec`s to handle additional GaussDB data types
2321

2422
Next steps:
2523

2624
* Multi-dimensional arrays
2725

28-
[p]: https://www.postgresql.org
26+
[p]: https://www.huaweicloud.com/product/gaussdb.html
2927
[r]: https://github.com/r2dbc/r2dbc-spi
3028

3129
## Code of Conduct
@@ -34,12 +32,12 @@ This project is governed by the [Code of Conduct](.github/CODE_OF_CONDUCT.adoc).
3432

3533
## Getting Started
3634

37-
Here is a quick teaser of how to use R2DBC PostgreSQL in Java:
35+
Here is a quick teaser of how to use R2DBC GaussDB in Java:
3836

3937
**URL Connection Factory Discovery**
4038

4139
```java
42-
ConnectionFactory connectionFactory = ConnectionFactories.get("r2dbc:postgresql://<host>:5432/<database>");
40+
ConnectionFactory connectionFactory = ConnectionFactories.get("r2dbc:gaussdb://<host>:5432/<database>");
4341

4442
Publisher<? extends Connection> connectionPublisher = connectionFactory.create();
4543
```
@@ -48,11 +46,9 @@ Publisher<? extends Connection> connectionPublisher = connectionFactory.create()
4846

4947
```java
5048
Map<String, String> options = new HashMap<>();
51-
options.put("lock_timeout", "10s");
52-
options.put("statement_timeout", "5m");
5349

5450
ConnectionFactory connectionFactory = ConnectionFactories.get(ConnectionFactoryOptions.builder()
55-
.option(DRIVER, "postgresql")
51+
.option(DRIVER, "gaussdb")
5652
.option(HOST, "...")
5753
.option(PORT, 5432) // optional, defaults to 5432
5854
.option(USER, "...")
@@ -72,7 +68,7 @@ Mono<Connection> connectionMono = Mono.from(connectionFactory.create());
7268
| Option | Description
7369
|---------------------------------| -----------
7470
| `ssl` | Enables SSL usage (`SSLMode.VERIFY_FULL`).
75-
| `driver` | Must be `postgresql`.
71+
| `driver` | Must be `gaussdb`.
7672
| `protocol` | Protocol specifier. Empty to use single-host operations. Supported: `failover` for multi-server failover operations. _(Optional)_
7773
| `host` | Server hostname to connect to. May contain a comma-separated list of hosts with ports when using the `failover` protocol.
7874
| `port` | Server port to connect to. Defaults to `5432`. _(Optional)_
@@ -113,8 +109,6 @@ Mono<Connection> connectionMono = Mono.from(connectionFactory.create());
113109

114110
```java
115111
Map<String, String> options = new HashMap<>();
116-
options.put("lock_timeout", "10s");
117-
118112
PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(PostgresqlConnectionConfiguration.builder()
119113
.host("...")
120114
.port(5432) // optional, defaults to 5432
@@ -127,7 +121,7 @@ PostgresqlConnectionFactory connectionFactory = new PostgresqlConnectionFactory(
127121
Mono<Connection> mono = connectionFactory.create();
128122
```
129123

130-
PostgreSQL uses index parameters that are prefixed with `$`. The following SQL statement makes use of parameters:
124+
GaussDB uses index parameters that are prefixed with `$`. The following SQL statement makes use of parameters:
131125

132126
```sql
133127
INSERT INTO person (id, first_name, last_name) VALUES ($1, $2, $3)
@@ -148,12 +142,12 @@ Binding also allowed positional index (zero-based) references. The parameter in
148142

149143
### Maven configuration
150144

151-
Artifacts can be found on [Maven Central](https://search.maven.org/search?q=r2dbc-postgresql).
145+
Artifacts can be found on [Maven Central](https://search.maven.org/search?q=gaussdb-r2dbc).
152146

153147
```xml
154148
<dependency>
155-
<groupId>org.postgresql</groupId>
156-
<artifactId>r2dbc-postgresql</artifactId>
149+
<groupId>com.huaweicloud.gaussdb</groupId>
150+
<artifactId>gaussdb-r2dbc</artifactId>
157151
<version>${version}</version>
158152
</dependency>
159153
```
@@ -162,9 +156,9 @@ If you'd rather like the latest snapshots of the upcoming major version, use our
162156

163157
```xml
164158
<dependency>
165-
<groupId>org.postgresql</groupId>
166-
<artifactId>r2dbc-postgresql</artifactId>
167-
<version>${version}.BUILD-SNAPSHOT</version>
159+
<groupId>com.huaweicloud.gaussdb</groupId>
160+
<artifactId>gaussdb-r2dbc</artifactId>
161+
<version>${version}.SNAPSHOT</version>
168162
</dependency>
169163

170164
<repository>
@@ -182,18 +176,18 @@ in order until the connection succeeds. If none succeeds a normal connection exc
182176
The syntax for the connection url is:
183177

184178
```
185-
r2dbc:postgresql:failover://user:foo@host1:5433,host2:5432,host3
179+
r2dbc:gaussdb:failover://user:foo@host1:5433,host2:5432,host3
186180
```
187181

188182
For example an application can create two connection pools. One data source is for writes, another for reads. The write pool limits connections only to a primary node:
189183

190184
```
191-
r2dbc:postgresql:failover://user:foo@host1:5433,host2:5432,host3?targetServerType=primary.
185+
r2dbc:gaussdb:failover://user:foo@host1:5433,host2:5432,host3?targetServerType=primary.
192186
```
193187

194188
## Cursors
195189

196-
R2DBC Postgres supports both, the [simple](https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.5.7.4)
190+
R2DBC GaussDB supports both, the [simple](https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.5.7.4)
197191
and [extended](https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY) message flow.
198192

199193
Cursored fetching is activated by configuring a `fetchSize`. Postgres cursors are valid for the duration of a transaction. R2DBC can use cursors in auto-commit mode (`Execute` and `Flush`) to not
@@ -391,7 +385,7 @@ Flux<T> replicationStream = replicationConnection.startReplication(replicationRe
391385
});
392386
```
393387

394-
## Postgres Enum Types
388+
## GaussDB Enum Types
395389

396390
Applications may make use of Postgres enumerated types by using `EnumCodec` to map custom types to Java `enum` types.
397391
`EnumCodec` requires the Postgres OID and the Java to map enum values to the Postgres protocol and to materialize Enum instances from Postgres results.

pom.xml

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
<modelVersion>4.0.0</modelVersion>
2424

25-
<groupId>org.postgresql</groupId>
26-
<artifactId>r2dbc-postgresql</artifactId>
27-
<version>1.1.0.BUILD-SNAPSHOT</version>
25+
<groupId>com.huaweicloud.gaussdb</groupId>
26+
<artifactId>gaussdb-r2dbc</artifactId>
27+
<version>0.0.1-SNAPSHOT</version>
2828
<packaging>jar</packaging>
2929

30-
<name>Reactive Relational Database Connectivity - Postgresql</name>
31-
<description>Reactive Relational Database Connectivity Driver Implementation for Postgresql</description>
32-
<url>https://github.com/pgjdbc/r2dbc-postgresql</url>
30+
<name>Reactive Relational Database Connectivity - GaussDB</name>
31+
<description>Reactive Relational Database Connectivity Driver Implementation for GaussDB</description>
32+
<url>https://github.com/HuaweiCloudDeveloper/gaussdb-r2dbc</url>
3333

3434
<properties>
3535
<assertj.version>3.25.3</assertj.version>
@@ -63,8 +63,8 @@
6363
</licenses>
6464

6565
<scm>
66-
<connection>scm:git:https://github.com/pgjdbc/r2dbc-postgresql</connection>
67-
<url>https://github.com/pgjdbc/r2dbc-postgresql</url>
66+
<connection>scm:git:https://github.com/HuaweiCloudDeveloper/gaussdb-r2dbc</connection>
67+
<url>https://github.com/HuaweiCloudDeveloper/gaussdb-r2dbc</url>
6868
</scm>
6969

7070
<developers>
@@ -288,7 +288,7 @@
288288
</manifest>
289289
<manifestEntries>
290290
<R2DBC-Specification-Version>${r2dbc-spi.version}</R2DBC-Specification-Version>
291-
<Automatic-Module-Name>r2dbc.postgresql</Automatic-Module-Name>
291+
<Automatic-Module-Name>gaussdb.r2dbc</Automatic-Module-Name>
292292
</manifestEntries>
293293
</archive>
294294
</configuration>

0 commit comments

Comments
 (0)