how to get last_inserted_id in ezsql latest version 4?

Trying to get last inserted id using this line: $db->insert_id;

but it doesn't return anything in the latest version of ezsql.