Don't selecting inserted/updated row, if database can return it at once.

Trying to avoid unnecessary database requests, if database can return inserted/updated row at once.
Don't calling insert_id() if id is already known, which allows using not sequence-based ids.