Database Explorer ->insert() return ActiveRow on MySQL v8, integer on MySQLv.5.7

vptr
Member | 1
+
0
-

I have a table in MySQL with id (int, auto increment)

After insert I need to know last inserted ID.

I found that on mySQL server v.8 insert() retrun ActiveRow, but on MySQL v 5.7 return integer (number of affected rows).
For this time, I'm checking if return value is instance of ActiveRow, but it was surprise for me.

Is there some mention in documentation about it?

Or I have special situation, because my table has column uuid (char(36)) and trgigger Before insert SET new.uuid = uuid();

Kamil Valenta
Member | 767
+
+3
-

It is not dependent on the version of MySQL, it is dependent on the existence of the PK.

https://api.nette.org/…lection.html#…