MariaDB support for lastInsertId
leavestylecode opened this issue · 8 comments
leavestylecode commented
jklingsporn commented
Hello,
can you please tell me more about your configuration? The method should be overridden by the code generator in the actual DAO-implementations (see this generated DAO from the tests). However this only happens if the configured dialect for code generation is Mysql.
This is the relevant part in the code generator:
if (schema.getDatabase().getDialect().family().equals(SQLDialect.MYSQL)) {
out.println();
out.tab(1).override();
out.tab(1).println("protected java.util.function.Function<io.vertx.sqlclient.RowSet<io.vertx.sqlclient.Row>,Long> extractMysqlLastInsertProperty(){");
out.tab(2).println("return rs -> rs.property(io.vertx.mysqlclient.MySQLClient.LAST_INSERTED_ID);");
out.tab(1).println("}");
}
leavestylecode commented
My db is mariadb, so how can I fix that?
jklingsporn commented
For now you would need to fork the generate-module and change the VertxGeneratorBuilder
like this:
if (schema.getDatabase().getDialect().family().equals(SQLDialect.MYSQL) || schema.getDatabase().getDialect().family().equals(SQLDialect.MARIADB)) {
out.println();
out.tab(1).override();
out.tab(1).println("protected java.util.function.Function<io.vertx.sqlclient.RowSet<io.vertx.sqlclient.Row>,Long> extractMysqlLastInsertProperty(){");
out.tab(2).println("return rs -> rs.property(io.vertx.mysqlclient.MySQLClient.LAST_INSERTED_ID);");
out.tab(1).println("}");
}
Or wait until I've implemented it.
leavestylecode commented
I can wait 6.1.0 to use that😁
jklingsporn commented
Should be available on maven central. Please let me know if it works for you.
leavestylecode commented
Nice, It worked. 👏👏👏
leavestylecode commented
When will 6.1.0 be released ? Handsome man 😅
jklingsporn commented
Should be available at maven central.
leavestyle <notifications@github.com> schrieb am Do., 7. Jan. 2021, 07:30:
… When will 6.1.0 be released ? Handsome man 😅
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQLZXW4EVXQXCIECTJUBF3SYVIGTANCNFSM4VXCIQEQ>
.