Skip to content

Commit 6fa6a56

Browse files
authored
Standardize type mapping tables and improve documentation consistency across supported database clients. (#1607)
Motivation: - To align documentation structure across database clients for improved readability and consistency. - Enhance clarity of type mappings and add notes where relevant. Changes: - Reformatted and replaced unordered lists with tables in `index.adoc` files for MySQL, PostgreSQL, MSSQL, DB2, and Oracle clients. - Added details on unsupported types and particular conversion issues.
1 parent bc5cbba commit 6fa6a56

5 files changed

Lines changed: 625 additions & 410 deletions

File tree

vertx-db2-client/src/main/asciidoc/index.adoc

Lines changed: 97 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -187,39 +187,107 @@ include::tracing.adoc[]
187187

188188
== DB2 type mapping
189189

190-
Currently the client supports the following DB2 types
191-
192-
* BOOLEAN (`java.lang.Boolean`) (DB2 LUW only)
193-
* SMALLINT (`java.lang.Short`)
194-
* INTEGER (`java.lang.Integer`)
195-
* BIGINT (`java.lang.Long`)
196-
* REAL (`java.lang.Float`)
197-
* DOUBLE (`java.lang.Double`)
198-
* DECIMAL (`io.vertx.sqlclient.data.Numeric`)
199-
* CHAR (`java.lang.String`)
200-
* VARCHAR (`java.lang.String`)
201-
* ENUM (`java.lang.String`)
202-
* DATE (`java.time.LocalDate`)
203-
* TIME (`java.time.LocalTime`)
204-
* TIMESTAMP (`java.time.LocalDateTime`)
205-
* BINARY (`byte[]`)
206-
* VARBINARY (`byte[]`)
207-
* ROWID (`io.vertx.db2client.impl.drda.DB2RowId` or `java.sql.RowId`) (DB2 z/OS only)
208-
209-
Some types that are currently NOT supported are:
210-
211-
* XML
212-
* BLOB
213-
* CLOB
214-
* DBCLOB
215-
* GRAPHIC / VARGRAPHIC
216-
217-
For a further documentation on DB2 data types, see the following resources:
190+
Currently the client supports the following DB2 types:
191+
192+
[cols="<2,<3,<3", options="header"]
193+
|===
194+
| DB2 Type | Java Type | Notes
195+
196+
| `BOOLEAN`
197+
| `java.lang.Boolean`
198+
| DB2 LUW only
199+
200+
| `SMALLINT`
201+
| `java.lang.Short`
202+
|
203+
204+
| `INTEGER`
205+
| `java.lang.Integer`
206+
|
207+
208+
| `BIGINT`
209+
| `java.lang.Long`
210+
|
211+
212+
| `REAL`
213+
| `java.lang.Float`
214+
|
215+
216+
| `DOUBLE`
217+
| `java.lang.Double`
218+
|
219+
220+
| `DECIMAL`
221+
| `io.vertx.sqlclient.data.Numeric`
222+
|
223+
224+
| `CHAR`
225+
| `java.lang.String`
226+
|
227+
228+
| `VARCHAR`
229+
| `java.lang.String`
230+
|
231+
232+
| `ENUM`
233+
| `java.lang.String`
234+
|
235+
236+
| `DATE`
237+
| `java.time.LocalDate`
238+
|
239+
240+
| `TIME`
241+
| `java.time.LocalTime`
242+
|
243+
244+
| `TIMESTAMP`
245+
| `java.time.LocalDateTime`
246+
|
247+
248+
| `BINARY`
249+
| `byte[]`
250+
|
251+
252+
| `VARBINARY`
253+
| `byte[]`
254+
|
255+
256+
| `ROWID`
257+
| `io.vertx.db2client.impl.drda.DB2RowId` or `java.sql.RowId`
258+
| DB2 z/OS only
259+
|===
260+
261+
=== Unsupported types
262+
263+
The following types are not currently supported:
264+
265+
[cols="<2,<4", options="header"]
266+
|===
267+
| Type | Notes
268+
269+
| `XML`
270+
| Not implemented
271+
272+
| `BLOB`
273+
| Not implemented
274+
275+
| `CLOB`
276+
| Not implemented
277+
278+
| `DBCLOB`
279+
| Not implemented
280+
281+
| `GRAPHIC` / `VARGRAPHIC`
282+
| Not implemented
283+
|===
284+
285+
For further documentation on DB2 data types, see:
218286

219287
* https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0008483.html[DB2 for LUW 11.5 data types]
220288
* https://www.ibm.com/support/knowledgecenter/SSEPEK_12.0.0/sqlref/src/tpc/db2z_datatypesintro.html[DB2 for z/OS 12.0 data types]
221289

222-
Tuple decoding uses the above types when storing values, it also performs on the fly conversion of the actual value when possible:
290+
Tuple decoding uses the above types when storing values. It also performs on the fly conversion of the actual value when possible:
223291

224292
[source,$lang]
225293
----

vertx-mssql-client/src/main/asciidoc/index.adoc

Lines changed: 88 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,30 +162,94 @@ include::cursor.adoc[]
162162

163163
include::tracing.adoc[]
164164

165-
== Data types supported
166-
167-
Currently, the client supports the following SQL Server types:
168-
169-
* TINYINT(`java.lang.Short`)
170-
* SMALLINT(`java.lang.Short`)
171-
* INT(`java.lang.Integer`)
172-
* BIGINT(`java.lang.Long`)
173-
* BIT(`java.lang.Boolean`)
174-
* REAL(`java.lang.Float`)
175-
* DOUBLE(`java.lang.Double`)
176-
* NUMERIC/DECIMAL(`{@link java.math.BigDecimal}`)
177-
* CHAR/VARCHAR(`java.lang.String`)
178-
* NCHAR/NVARCHAR(`java.lang.String`)
179-
* DATE(`java.time.LocalDate`)
180-
* TIME(`java.time.LocalTime`)
181-
* SMALLDATETIME(`java.time.LocalDateTime`)
182-
* DATETIME(`java.time.LocalDateTime`)
183-
* DATETIME2(`java.time.LocalDateTime`)
184-
* DATETIMEOFFSET(`java.time.OffsetDateTime`)
185-
* BINARY/VARBINARY(`io.vertx.core.buffer.Buffer`)
186-
* MONEY (`{@link java.math.BigDecimal}`)
187-
* SMALLMONEY (`{@link java.math.BigDecimal}`)
188-
* GUID (`{@link java.util.UUID}`)
165+
== MSSQL type mapping
166+
167+
Currently the client supports the following SQL Server types:
168+
169+
[cols="<2,<3,<3", options="header"]
170+
|===
171+
| SQL Server Type | Java Type | Notes
172+
173+
| `TINYINT`
174+
| `java.lang.Short`
175+
|
176+
177+
| `SMALLINT`
178+
| `java.lang.Short`
179+
|
180+
181+
| `INT`
182+
| `java.lang.Integer`
183+
|
184+
185+
| `BIGINT`
186+
| `java.lang.Long`
187+
|
188+
189+
| `BIT`
190+
| `java.lang.Boolean`
191+
|
192+
193+
| `REAL`
194+
| `java.lang.Float`
195+
|
196+
197+
| `DOUBLE`
198+
| `java.lang.Double`
199+
|
200+
201+
| `NUMERIC` / `DECIMAL`
202+
| `java.math.BigDecimal`
203+
|
204+
205+
| `CHAR` / `VARCHAR`
206+
| `java.lang.String`
207+
|
208+
209+
| `NCHAR` / `NVARCHAR`
210+
| `java.lang.String`
211+
| Unicode strings
212+
213+
| `DATE`
214+
| `java.time.LocalDate`
215+
|
216+
217+
| `TIME`
218+
| `java.time.LocalTime`
219+
|
220+
221+
| `SMALLDATETIME`
222+
| `java.time.LocalDateTime`
223+
|
224+
225+
| `DATETIME`
226+
| `java.time.LocalDateTime`
227+
|
228+
229+
| `DATETIME2`
230+
| `java.time.LocalDateTime`
231+
|
232+
233+
| `DATETIMEOFFSET`
234+
| `java.time.OffsetDateTime`
235+
|
236+
237+
| `BINARY` / `VARBINARY`
238+
| `io.vertx.core.buffer.Buffer`
239+
|
240+
241+
| `MONEY`
242+
| `java.math.BigDecimal`
243+
|
244+
245+
| `SMALLMONEY`
246+
| `java.math.BigDecimal`
247+
|
248+
249+
| `GUID`
250+
| `java.util.UUID`
251+
|
252+
|===
189253

190254
Tuple decoding uses the above types when storing values.
191255

0 commit comments

Comments
 (0)