Dapper-Plus icon indicating copy to clipboard operation
Dapper-Plus copied to clipboard

PostgreSQL Bulk insert dynamic object mapping

Open abacusFan opened this issue 4 years ago • 3 comments

Hello there :)

I am trying to bulk insert a custom object which has json property in postgresSQL.

It's working perfectly if the property is a fixed class. by using this method: DapperPlusManager.AddCustomSupportedType

but once I tried to use dynamic object. it does not work. column value will be null e.g dynamic expando = new ExpandoObject();

Could you please help,

Thanks

abacusFan avatar Dec 15 '21 01:12 abacusFan

Hello @abacusFan,

We will look at it if there is something we can do.

Best Regards,

Jon

JonathanMagnan avatar Dec 15 '21 15:12 JonathanMagnan

Thank you Jon.

Either dynamic or Dictionary<String,Object> or other types are ok for me :)

as long as The json will be like { "Property1Name": Property1Value, "Property2Name": Property2Value }

Appreciate for your help

abacusFan avatar Dec 15 '21 21:12 abacusFan

Hi Jon,

Sorry to be annoying :)

Could you also support jsonb if possible.

I tried the fixed class to do bulk insert for jsonb column.

It's not working either.

abacusFan avatar Dec 19 '21 23:12 abacusFan