adding namespace support
conditionnal grabbing of the last insert ID if empty PK (auto_increment)