With source generators coming in C# 9, we can look into removing some reflection-based code-generation that we do. This would make Npgsql more compatible with AOT environments, improve startup perf a little and is safer (compile-time checking). Here's where we currently do code generation:
#3300 tracks making Npgsql friendlier to the linker (big overlap with this).