リアクティブ SQL クライアント
Reactive SQL クライアントは、スケーラビリティと低オーバーヘッドに焦点を当てたシンプルな API を持っています。現在、以下のデータベースサーバーがサポートされています。
-
IBM Db2
-
PostgreSQL
-
MariaDB/MySQL
-
Microsoft SQL Server
-
Oracle
Reactive SQL Client for Oracle は、techpreview と見なされます。 tech preview モードでは、アイデアを成熟させるために早期のフィードバックが求められます。ソリューションが成熟するまでの間、プラットフォームの安定性を保証するものではありません。フィードバックは mailing list や GitHub issue tracker で受け付けています。 |
このガイドでは、PostgreSQL に格納されたデータをRESTful APIで公開するシンプルなCRUDアプリケーションの実装方法を学びます。
各クライアントのエクステンションと接続プールのクラス名は、このドキュメントの下部に記載されています。 |
Quarkus Vert.x エクステンションに慣れていない場合は、まず Using Eclipse Vert.x ガイドを読むことを検討してください。 |
アプリケーションは、フルーツのエンティティを管理するものとします。
public class Fruit {
public Long id;
public String name;
public Fruit() {
}
public Fruit(String name) {
this.name = name;
}
public Fruit(Long id, String name) {
this.id = id;
this.name = name;
}
}
サンプルを試すためにすぐに使えるPostgreSQLサーバーが必要ですか?
|
インストール
リアクティブな PostgreSQL クライアントエクステンション
まず、プロジェクトで quarkus-reactive-pg-client
のエクステンションが有効になっていることを確認します。新しいプロジェクトを作成する場合は、次のコマンドを使用します。
すでに作成済みのプロジェクトがある場合は、add-extension
コマンドで既存のQuarkusプロジェクトに reactive-pg-client
エクステンションを追加することが出来ます。
quarkus extension add 'reactive-pg-client'
./mvnw quarkus:add-extension -Dextensions="reactive-pg-client"
./gradlew addExtension --extensions="reactive-pg-client"
それ以外の場合は、ビルドファイルに依存関係を手動で追加できます。
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-pg-client</artifactId>
</dependency>
implementation("io.quarkus:quarkus-reactive-pg-client")
Mutiny
RESTEasy Reactive には、Mutiny タイプ (Uni や Multi など) のサポートが含まれています。
このガイドでは、Reactive PostgreSQL Client の Mutiny API を使用します。Mutiny についてよく知らない方は、Mutiny - an intuitive reactive programming library を参照してください。 |
JSON バインディング
JSON 形式で HTTP 経由で Fruit
インスタンスを公開します。そのため、 quarkus-resteasy-reactive-jackson
のエクステンションも追加する必要があります。
quarkus extension add 'resteasy-jackson'
./mvnw quarkus:add-extension -Dextensions="resteasy-jackson"
./gradlew addExtension --extensions="resteasy-jackson"
コマンドラインを使用したくない場合は、ビルドファイルに依存関係を手動で追加します。
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
</dependency>
implementation("io.quarkus:quarkus-resteasy-reactive-jackson")
もちろん、これはこのガイドの要件に過ぎず、Reactive PostgreSQLクライアントを使用したアプリケーションではありません。
設定
Reactive PostgreSQLクライアントは、Quarkusの標準的なデータソースプロパティーとReactive URLを使用して設定することができます。
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=quarkus_test
quarkus.datasource.password=quarkus_test
quarkus.datasource.reactive.url=postgresql://localhost:5432/quarkus_test
これで FruitResource
スケルトンと @Inject
io.vertx.mutiny.pgclient.PgPool
インスタンスを作成することができます。
@Path("fruits")
public class FruitResource {
@Inject
io.vertx.mutiny.pgclient.PgPool client;
}
データベーススキーマとシードデータ
Before we implement the REST endpoint and data management code, we need to set up the database schema. It would also be convenient to have some data inserted up-front.
For production, we would recommend to use something like the Flyway database migration tool. But for development we can simply drop and create the tables on startup, and then insert a few fruits.
@Inject
@ConfigProperty(name = "myapp.schema.create", defaultValue = "true") (1)
boolean schemaCreate;
void config(@Observes StartupEvent ev) {
if (schemaCreate) {
initdb();
}
}
private void initdb() {
// TODO
}
application.properties ファイルの myapp.schema.create プロパティーのデフォルト値を上書きできます。
|
ほとんど準備ができています! 開発モードで DB を初期化するには、クライアントの単純な query
メソッドを使用します。Uni
を返すため、クエリーを順番に実行するように設定できます。
client.query("DROP TABLE IF EXISTS fruits").execute()
.flatMap(r -> client.query("CREATE TABLE fruits (id SERIAL PRIMARY KEY, name TEXT NOT NULL)").execute())
.flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Orange')").execute())
.flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Pear')").execute())
.flatMap(r -> client.query("INSERT INTO fruits (name) VALUES ('Apple')").execute())
.await().indefinitely();
最新のクエリーが完了するまでブロックが必要なのはなぜですか? このコードは @PostConstruct メソッドの一部であり、Quarkus はそれを同期的に呼び出します。結果として、返すのが早すぎると、データベースの準備ができていないときにリクエストを処理する可能性があります。
|
以上です。これまで、プールされたクライアントを設定し、単純なクエリーを実行する方法を見てきました。これで、データ管理コードを開発し、RESTful エンドポイントを実装する準備が整いました。
使用
クエリー結果のトラバーサル
開発モードでは、データベースは fruits
テーブルのいくつかの行で設定されます。すべてのデータを取得するには、query
メソッドを再度使用します。
Uni<RowSet<Row>> rowSet = client.query("SELECT id, name FROM fruits ORDER BY name ASC").execute();
操作が完了すると、すべての行がメモリーにバッファーリングされた RowSet
を取得します。RowSet
は java.lang.Iterable<Row>
です。したがって、 Multi
に変換できます。
Multi<Fruit> fruits = rowSet
.onItem().transformToMulti(set -> Multi.createFrom().iterable(set))
.onItem().transform(Fruit::from);
Fruit#from
メソッドは Row
インスタンスを Fruit
インスタンスに変換します。これは、他のデータ管理方法の実装の便宜のために展開されています。
private static Fruit from(Row row) {
return new Fruit(row.getLong("id"), row.getString("name"));
}
すべてをまとめると、Fruit.findAll
メソッドは次のようになります。
public static Multi<Fruit> findAll(PgPool client) {
return client.query("SELECT id, name FROM fruits ORDER BY name ASC").execute()
.onItem().transformToMulti(set -> Multi.createFrom().iterable(set))
.onItem().transform(Fruit::from);
}
そして、バックエンドからすべての fruits を取得するためのエンドポイント:
@GET
public Multi<Fruit> get() {
return Fruit.findAll(client);
}
ここで、開発モードで Quarkus を起動します。
quarkus dev
./mvnw quarkus:dev
./gradlew --console=plain quarkusDev
最後に、ブラウザーを開いて http://localhost:8080/fruits に移動します。次のように表示されます。
[{"id":3,"name":"Apple"},{"id":1,"name":"Orange"},{"id":2,"name":"Pear"}]
準備されたクエリー
Reactive PostgreSQL Client は、クエリーを準備し、実行時に SQL ステートメントで置き換えられるパラメーターを取得することもできます。
client.preparedQuery("SELECT id, name FROM fruits WHERE id = $1").execute(Tuple.of(id))
PostgreSQL の場合、SQL 文字列は $1 、$2 などのように位置でパラメーターを参照することができます。他のデータベースについては、[Database Clients details] のセクションを参照してください。
|
単純な query
メソッドと同様に、preparedQuery
は PreparedQuery<RowSet<Row>>
のインスタンスを返します。このツールを装備すると、ユーザーから提供された id
を安全に使用して、特定の fruit の詳細を取得できます。
public static Uni<Fruit> findById(PgPool client, Long id) {
return client.preparedQuery("SELECT id, name FROM fruits WHERE id = $1").execute(Tuple.of(id)) (1)
.onItem().transform(RowSet::iterator) (2)
.onItem().transform(iterator -> iterator.hasNext() ? from(iterator.next()) : null); (3)
}
1 | 準備されたクエリーパラメーターを保持するための Tuple を作成します。 |
2 | RowSet の結果に対して Iterator を取得します。 |
3 | エンティティーが見つかった場合は、Row から Fruit インスタンスを作成します。 |
そして、JAX-RS リソースでは:
@GET
@Path("{id}")
public Uni<Response> getSingle(Long id) {
return Fruit.findById(client, id)
.onItem().transform(fruit -> fruit != null ? Response.ok(fruit) : Response.status(Status.NOT_FOUND)) (1)
.onItem().transform(ResponseBuilder::build); (2)
}
1 | 見つかった場合は Fruit インスタンスまたは 404 ステータスコードのいずれかを使用して JAX-RS 応答を準備します。 |
2 | レスポンスを構築して送信します。 |
Fruit
を保存するときに同じロジックが適用されます。
public Uni<Long> save(PgPool client) {
return client.preparedQuery("INSERT INTO fruits (name) VALUES ($1) RETURNING id").execute(Tuple.of(name))
.onItem().transform(pgRowSet -> pgRowSet.iterator().next().getLong("id"));
}
また、Web リソースでは、POST
リクエストを処理します。
@POST
public Uni<Response> create(Fruit fruit) {
return fruit.save(client)
.onItem().transform(id -> URI.create("/fruits/" + id))
.onItem().transform(uri -> Response.created(uri).build());
}
結果のメタデータ
RowSet
はデータをメモリーに保持するだけでなく、次のようなデータ自体に関する情報も提供します。
-
クエリーの影響を受ける行数 (クエリータイプに応じて挿入/削除/更新/取得)、
-
列名。
これを使用して、データベース内の fruits の削除をサポートしましょう。
public static Uni<Boolean> delete(PgPool client, Long id) {
return client.preparedQuery("DELETE FROM fruits WHERE id = $1").execute(Tuple.of(id))
.onItem().transform(pgRowSet -> pgRowSet.rowCount() == 1); (1)
}
1 | メタデータを調べて、fruit が実際に削除されたかどうかを判断します。 |
また、Web リソースで HTTP の DELETE
メソッドを処理するには:
@DELETE
@Path("{id}")
public Uni<Response> delete(Long id) {
return Fruit.delete(client, id)
.onItem().transform(deleted -> deleted ? Status.NO_CONTENT : Status.NOT_FOUND)
.onItem().transform(status -> Response.status(status).build());
}
GET
、POST
、および DELETE
メソッドが実装されたので、RESTful アプリケーションを試すための最小限の Web ページを作成できます。 jQuery を使用して、バックエンドとのやり取りを簡素化します。
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Reactive PostgreSQL Client - Quarkus</title>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script type="application/javascript" src="fruits.js"></script>
</head>
<body>
<h1>Fruits API テスト</h1>
<h2>すべての fruits</h2>
<div id="all-fruits"></div>
<h2>Fruit の作成</h2>
<input id="fruit-name" type="text">
<button id="create-fruit-button" type="button">Create</button>
<div id="create-fruit"></div>
</body>
</html>
Javascript コードでは、次の場合に fruits のリストを更新する関数が必要です。
-
ページが読み込まれる、または
-
fruit が追加される、または
-
fruit は削除される。
function refresh() {
$.get('/fruits', function (fruits) {
var list = '';
(fruits || []).forEach(function (fruit) { (1)
list = list
+ '<tr>'
+ '<td>' + fruit.id + '</td>'
+ '<td>' + fruit.name + '</td>'
+ '<td><a href="#" onclick="deleteFruit(' + fruit.id + ')">Delete</a></td>'
+ '</tr>'
});
if (list.length > 0) {
list = ''
+ '<table><thead><th>Id</th><th>Name</th><th></th></thead>'
+ list
+ '</table>';
} else {
list = "No fruits in database"
}
$('#all-fruits').html(list);
});
}
function deleteFruit(id) {
$.ajax('/fruits/' + id, {method: 'DELETE'}).then(refresh);
}
$(document).ready(function () {
$('#create-fruit-button').click(function () {
var fruitName = $('#fruit-name').val();
$.post({
url: '/fruits',
contentType: 'application/json',
data: JSON.stringify({name: fruitName})
}).then(refresh);
});
refresh();
});
1 | データベースが空の場合、fruits パラメーターは定義されません。 |
すべて完了! http://localhost:8080/fruits.html に移動し、いくつかの fruits を読み取り/作成/削除します。
データベースクライアントの詳細
Database | 拡張子名 | プールクラス名 | プレースホルダー |
---|---|---|---|
IBM Db2 |
|
|
|
MariaDB/MySQL |
|
|
|
Microsoft SQL Server |
|
|
|
Oracle |
|
|
|
PostgreSQL |
|
|
$1`、 |
トランザクション
リアクティブ SQL クライアントはトランザクションをサポートします。トランザクションは io.vertx.mutiny.sqlclient.SqlConnection#begin
で開始され、io.vertx.mutiny.sqlclient.Transaction#commit
または io.vertx.mutiny.sqlclient.Transaction#rollback
で終了します。これらの操作はすべて非同期です。
-
connection.begin()
returns aUni<Transaction>
-
transaction.commit()
andtransaction.rollback()
returnUni<Void>
リアクティブプログラミングの世界でトランザクションを管理するのは面倒な場合があります。反復的で複雑な (したがってエラーが発生しやすい) コードを記述する代わりに、io.vertx.mutiny.sqlclient.Pool#withTransaction
ヘルパーメソッドを使用できます。
次のスニペットは、同じトランザクションで 2 つの挿入を実行する方法を示しています。
public static Uni<Void> insertTwoFruits(PgPool client, Fruit fruit1, Fruit fruit2) {
return client.withTransaction(conn -> {
Uni<RowSet<Row>> insertOne = conn.preparedQuery("INSERT INTO fruits (name) VALUES ($1) RETURNING id")
.execute(Tuple.of(fruit1.name));
Uni<RowSet<Row>> insertTwo = conn.preparedQuery("INSERT INTO fruits (name) VALUES ($1) RETURNING id")
.execute(Tuple.of(fruit2.name));
return Uni.combine().all().unis(insertOne, insertTwo)
// Ignore the results (the two ids)
.discardItems();
});
}
この例では、トランザクションは成功時に自動的にコミットされるか、失敗時にロールバックされます。
次のように依存アクションを作成することもできます。
return client.withTransaction(conn -> conn
.preparedQuery("INSERT INTO person (firstname,lastname) VALUES ($1,$2) RETURNING id")
.execute(Tuple.of(person.getFirstName(), person.getLastName()))
.onItem().transformToUni(id -> conn.preparedQuery("INSERT INTO addr (person_id,addrline1) VALUES ($1,$2)")
.execute(Tuple.of(id.iterator().next().getLong("id"), person.getLastName())))
.onItem().ignore().andContinueWithNull());
バッチクエリー結果の操作
バッチクエリーを実行すると、リアクティブ SQL クライアントはバッチの最初の要素の結果に対応する RowSet
を返します。次のバッチ要素の結果を取得するには、null
が返されるまで RowSet#next
メソッドを呼び出す必要があります。
いくつかの行を更新し、影響を受ける行の総数を計算するとします。各 RowSet
を検査する必要があります。
PreparedQuery<RowSet<Row>> preparedQuery = client.preparedQuery("UPDATE fruits SET name = $1 WHERE id = $2");
Uni<RowSet<Row>> rowSet = preparedQuery.executeBatch(Arrays.asList(
Tuple.of("Orange", 1),
Tuple.of("Pear", 2),
Tuple.of("Apple", 3)));
Uni<Integer> totalAffected = rowSet.onItem().transform(res -> {
int total = 0;
do {
total += res.rowCount(); (1)
} while ((res = res.next()) != null); (2)
return total;
});
1 | RowSet#rowCount の合計を計算します。 |
2 | null を返すまで RowSet#next を呼び出します。 |
別の例として、挿入したばかりのすべての行をロードする場合は、各 RowSet
の内容を連結する必要があります。
PreparedQuery<RowSet<Row>> preparedQuery = client.preparedQuery("INSERT INTO fruits (name) VALUES ($1) RETURNING *");
Uni<RowSet<Row>> rowSet = preparedQuery.executeBatch(Arrays.asList(
Tuple.of("Orange"),
Tuple.of("Pear"),
Tuple.of("Apple")));
// 複数の RowSet アイテムを生成します
Multi<RowSet<Row>> rowSets = rowSet.onItem().transformToMulti(res -> {
return Multi.createFrom().generator(() -> res, (rs, emitter) -> {
RowSet<Row> next = null;
if (rs != null) {
emitter.emit(rs);
next = rs.next();
}
if (next == null) {
emitter.complete();
}
return next;
});
});
// 各 RowSet を複数の行アイテムに変換して連結します
Multi<Row> rows = rowSets.onItem().transformToMultiAndConcatenate(Multi.createFrom()::iterable);
複数のデータソース
Reactive SQL クライアントは、複数のデータソースの定義をサポートしています。
複数のデータソースを使用した典型的な構成は以下のようになります。
quarkus.datasource.db-kind=postgresql (1)
quarkus.datasource.username=user-default
quarkus.datasource.password=password-default
quarkus.datasource.reactive.url=postgresql://localhost:5432/default
quarkus.datasource."additional1".db-kind=postgresql (2)
quarkus.datasource."additional1".username=user-additional1
quarkus.datasource."additional1".password=password-additional1
quarkus.datasource."additional1".reactive.url=postgresql://localhost:5432/additional1
quarkus.datasource."additional2".db-kind=mysql (3)
quarkus.datasource."additional2".username=user-additional2
quarkus.datasource."additional2".password=password-additional2
quarkus.datasource."additional2".reactive.url=mysql://localhost:3306/additional2
1 | デフォルトのデータソース - PostgreSQL を使用。 |
2 | additional1 と呼ばれる名前付きデータソース - PostgreSQL を使用。 |
3 | additional2 と呼ばれる名前付きデータソース - MySQL を使用。 |
次に、次のようにクライアントを挿入できます。
@Inject (1)
PgPool defaultClient;
@Inject
@ReactiveDataSource("additional1") (2)
PgPool additional1Client;
@Inject
@ReactiveDataSource("additional2")
MySQLPool additional2Client;
1 | デフォルトのデータソースにクライアントを挿入するために特別なことは何も必要ありません。 |
2 | 名前付きデータソースの場合、値としてデータソース名を指定して @ReactiveDataSource CDI 修飾子を使用します。 |
UNIX ドメインソケット接続
PostgreSQL および MariaDB/MySQL クライアントは、UNIX ドメインソケットを介してサーバーに接続するように設定できます。
まず、native transport support が有効になっていることを確認します。
次に、データベース接続の URL を設定します。この手順は、データベースのタイプによって異なります。
PostgreSQL
PostgreSQL domain socket paths have the following form: <directory>/.s.PGSQL.<port>
データベース接続の URL は、次のように設定する必要があります。
-
host
はソケットパスのdirectory
です -
port
はソケットパスのport
です
次のソケットパスを検討してください: /var/run/postgresql/.s.PGSQL.5432
。
application.properties
で以下を追加します。
quarkus.datasource.reactive.url=postgresql://:5432/quarkus_test?host=/var/run/postgresql
プールされた接続 idle-timeout
リアクティブデータソースは、idle-timeout
(ミリ秒単位) で設定できます。これは、接続が閉じられる前に、接続がプール内で未使用のままである最大時間です。
idle-timeout はデフォルトで無効になっています。
|
たとえば、アイドル状態の接続を 60 分後に期限切れにすることができます。
quarkus.datasource.reactive.idle-timeout=PT60M
設定リファレンス
共通のデータソース
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
The kind of database we will connect to (e.g. h2, postgresql…). Environment variable: |
string |
|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The container start command to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
The name of the database to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The username to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The password to use if this Dev Service supports overriding it. Environment variable: |
string |
|
Whether this particular data source should be excluded from the health check if the general health check for data sources is enabled. By default, the health check includes all configured data sources (if it is enabled). Environment variable: |
boolean |
|
Whether or not an health check is published in case the smallrye-health extension is present. This is a global setting and is not specific to a datasource. Environment variable: |
boolean |
|
Whether or not datasource metrics are published in case a metrics extension is present. This is a global setting and is not specific to a datasource. NOTE: This is different from the "jdbc.enable-metrics" property that needs to be set on the JDBC datasource level to enable collection of metrics for that datasource. Environment variable: |
boolean |
|
The datasource username Environment variable: |
string |
|
The datasource password Environment variable: |
string |
|
The credentials provider name Environment variable: |
string |
|
The credentials provider bean name.
It is the Environment variable: |
string |
|
Generic properties that are passed for additional container configuration. Properties defined here are database specific and are interpreted specifically in each database dev service implementation. Environment variable: |
|
|
Generic properties that are added to the database connection URL. Environment variable: |
|
|
タイプ |
デフォルト |
|
The kind of database we will connect to (e.g. h2, postgresql…). Environment variable: |
string |
|
If DevServices has been explicitly enabled or disabled. DevServices is generally enabled by default, unless there is an existing configuration present. When DevServices is enabled Quarkus will attempt to automatically configure and start a database when running in Dev or Test mode. Environment variable: |
boolean |
|
The container image name to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
Generic properties that are passed for additional container configuration. Properties defined here are database specific and are interpreted specifically in each database dev service implementation. Environment variable: |
|
|
Generic properties that are added to the database connection URL. Environment variable: |
|
|
Optional fixed port the dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
The container start command to use, for container based DevServices providers. If the provider is not container based (e.g. a H2 Database) then this has no effect. Environment variable: |
string |
|
The name of the database to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The username to use if this Dev Service supports overriding it. Environment variable: |
string |
|
The password to use if this Dev Service supports overriding it. Environment variable: |
string |
|
Whether this particular data source should be excluded from the health check if the general health check for data sources is enabled. By default, the health check includes all configured data sources (if it is enabled). Environment variable: |
boolean |
|
The datasource username Environment variable: |
string |
|
The datasource password Environment variable: |
string |
|
The credentials provider name Environment variable: |
string |
|
The credentials provider bean name.
It is the Environment variable: |
string |
リアクティブデータソース
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
If we create a Reactive datasource for this datasource. Environment variable: |
boolean |
|
Whether prepared statements should be cached on the client side. Environment variable: |
boolean |
|
The datasource URL. Environment variable: |
string |
|
The datasource pool maximum size. Environment variable: |
int |
|
When a new connection object is created, the pool assigns it an event loop.
When Environment variable: |
int |
|
Whether all server certificates should be trusted. Environment variable: |
boolean |
|
PEM Trust config is disabled by default. Environment variable: |
boolean |
|
Comma-separated list of the trust certificate files (Pem format). Environment variable: |
list of string |
|
JKS config is disabled by default. Environment variable: |
boolean |
|
Path of the key file (JKS format). Environment variable: |
string |
|
Password of the key file. Environment variable: |
string |
|
PFX config is disabled by default. Environment variable: |
boolean |
|
Path to the key file (PFX format). Environment variable: |
string |
|
Password of the key. Environment variable: |
string |
|
PEM Key/cert config is disabled by default. Environment variable: |
boolean |
|
Comma-separated list of the path to the key files (Pem format). Environment variable: |
list of string |
|
Comma-separated list of the path to the certificate files (Pem format). Environment variable: |
list of string |
|
JKS config is disabled by default. Environment variable: |
boolean |
|
Path of the key file (JKS format). Environment variable: |
string |
|
Password of the key file. Environment variable: |
string |
|
PFX config is disabled by default. Environment variable: |
boolean |
|
Path to the key file (PFX format). Environment variable: |
string |
|
Password of the key. Environment variable: |
string |
|
The number of reconnection attempts when a pooled connection cannot be established on first try. Environment variable: |
int |
|
The interval between reconnection attempts when a pooled connection cannot be established on first try. Environment variable: |
|
|
The hostname verification algorithm to use in case the server’s identity should be checked. Should be HTTPS, LDAPS or an empty string. Environment variable: |
string |
|
The maximum time a connection remains unused in the pool before it is closed. Environment variable: |
|
|
Set to true to share the pool among datasources. There can be multiple shared pools distinguished by name, when no specific name is set, the Environment variable: |
boolean |
|
Set the pool name, used when the pool is shared among datasources, otherwise ignored. Environment variable: |
string |
|
Other unspecified properties to be passed through the Reactive SQL Client directly to the database when new connections are initiated. Environment variable: |
|
|
タイプ |
デフォルト |
|
If we create a Reactive datasource for this datasource. Environment variable: |
boolean |
|
Whether prepared statements should be cached on the client side. Environment variable: |
boolean |
|
The datasource URL. Environment variable: |
string |
|
The datasource pool maximum size. Environment variable: |
int |
|
When a new connection object is created, the pool assigns it an event loop.
When Environment variable: |
int |
|
Whether all server certificates should be trusted. Environment variable: |
boolean |
|
PEM Trust config is disabled by default. Environment variable: |
boolean |
|
Comma-separated list of the trust certificate files (Pem format). Environment variable: |
list of string |
|
JKS config is disabled by default. Environment variable: |
boolean |
|
Path of the key file (JKS format). Environment variable: |
string |
|
Password of the key file. Environment variable: |
string |
|
PFX config is disabled by default. Environment variable: |
boolean |
|
Path to the key file (PFX format). Environment variable: |
string |
|
Password of the key. Environment variable: |
string |
|
PEM Key/cert config is disabled by default. Environment variable: |
boolean |
|
Comma-separated list of the path to the key files (Pem format). Environment variable: |
list of string |
|
Comma-separated list of the path to the certificate files (Pem format). Environment variable: |
list of string |
|
JKS config is disabled by default. Environment variable: |
boolean |
|
Path of the key file (JKS format). Environment variable: |
string |
|
Password of the key file. Environment variable: |
string |
|
PFX config is disabled by default. Environment variable: |
boolean |
|
Path to the key file (PFX format). Environment variable: |
string |
|
Password of the key. Environment variable: |
string |
|
The number of reconnection attempts when a pooled connection cannot be established on first try. Environment variable: |
int |
|
The interval between reconnection attempts when a pooled connection cannot be established on first try. Environment variable: |
|
|
The hostname verification algorithm to use in case the server’s identity should be checked. Should be HTTPS, LDAPS or an empty string. Environment variable: |
string |
|
The maximum time a connection remains unused in the pool before it is closed. Environment variable: |
|
|
Set to true to share the pool among datasources. There can be multiple shared pools distinguished by name, when no specific name is set, the Environment variable: |
boolean |
|
Set the pool name, used when the pool is shared among datasources, otherwise ignored. Environment variable: |
string |
|
Other unspecified properties to be passed through the Reactive SQL Client directly to the database when new connections are initiated. Environment variable: |
|
期間フォーマットについて
期間のフォーマットは標準の 数値で始まる期間の値を指定することもできます。この場合、値が数値のみで構成されている場合、コンバーターは値を秒として扱います。そうでない場合は、 |
IBM Db2
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
Whether SSL/TLS is enabled. Environment variable: |
boolean |
|
タイプ |
デフォルト |
|
Whether SSL/TLS is enabled. Environment variable: |
boolean |
|
MariaDB/MySQL
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
Charset for connections. Environment variable: |
string |
|
Collation for connections. Environment variable: |
string |
|
Desired security state of the connection to the server. See MySQL Reference Manual. Environment variable: |
|
|
タイプ |
デフォルト |
|
Charset for connections. Environment variable: |
string |
|
Collation for connections. Environment variable: |
string |
|
Desired security state of the connection to the server. See MySQL Reference Manual. Environment variable: |
|
|
Microsoft SQL Server
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
The desired size (in bytes) for TDS packets. Environment variable: |
int |
|
Whether SSL/TLS is enabled. Environment variable: |
boolean |
|
タイプ |
デフォルト |
|
The desired size (in bytes) for TDS packets. Environment variable: |
int |
|
Whether SSL/TLS is enabled. Environment variable: |
boolean |
|
PostgreSQL
ビルド時に固定される設定プロパティ - それ以外の設定プロパティは実行時に上書き可能
タイプ |
デフォルト |
|
---|---|---|
The maximum number of inflight database commands that can be pipelined. Environment variable: |
int |
|
SSL operating mode of the client. See Protection Provided in Different Modes. Environment variable: |
|
|
タイプ |
デフォルト |
|
The maximum number of inflight database commands that can be pipelined. Environment variable: |
int |
|
SSL operating mode of the client. See Protection Provided in Different Modes. Environment variable: |
|
|