Skip to content

Commit

Permalink
Use GENERATED BY DEFAULT AS IDENTITY instead of AUTO_INCREMENT.
Browse files Browse the repository at this point in the history
Based on feedback, switch incrementing logic.

See also: #163 (comment)
  • Loading branch information
gregturn committed Jan 14, 2021
1 parent 33563fe commit 001ee8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/test/java/io/r2dbc/h2/H2StatementTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void returnGenerateValuesNoArguments() throws Exception {

SERVER.beforeAll(null);

SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER AUTO_INCREMENT, id2 INTEGER AUTO_INCREMENT, value INTEGER);");
SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, id2 INTEGER GENERATED BY DEFAULT AS IDENTITY, value INTEGER);");

Mono.from(connectionFactory.create())
.flatMapMany(connection -> Flux.from(connection
Expand Down Expand Up @@ -267,7 +267,7 @@ void returnGeneratedValuesNotUsed() throws Exception {

SERVER.beforeAll(null);

SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER AUTO_INCREMENT, id2 INTEGER AUTO_INCREMENT, value INTEGER);");
SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, id2 INTEGER GENERATED BY DEFAULT AS IDENTITY, value INTEGER);");

Mono.from(connectionFactory.create())
.flatMapMany(connection -> Flux.from(connection
Expand Down Expand Up @@ -299,7 +299,7 @@ void returnGeneratedValuesSpecificColumn() throws Exception {

SERVER.beforeAll(null);

SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER AUTO_INCREMENT, id2 INTEGER AUTO_INCREMENT, value INTEGER);");
SERVER.getJdbcOperations().execute("CREATE TABLE test ( id INTEGER GENERATED BY DEFAULT AS IDENTITY, id2 INTEGER GENERATED BY DEFAULT AS IDENTITY, value INTEGER);");

Mono.from(connectionFactory.create())
.flatMapMany(connection -> Flux.from(connection
Expand Down

0 comments on commit 001ee8d

Please sign in to comment.