by biarity · 8y ago · 0 comments
Checking first and failing can still be problematic without the right database isolation setting.
Better to try it and catch the database error (which might include another unique constraint other than primary key... depending on db design).