write query callback to fetch row id, int32 type safety check