do SQL id -> string cast correctly for postgres & mysql