IrenejMarc / dpq

Simple but powerful PostgreSQL library inspired by higher-level languages.
MIT License
21 stars 9 forks source link

Add support for serializing BigInt to NUMERIC #16

Open bluebear94 opened 8 years ago

bluebear94 commented 8 years ago

I'd like to create a game with support for enormous amounts of damage, and having dpq automatically serialize BigInts (from std.bigint, not the PostgreSQL type) would be convenient.

IrenejMarc commented 8 years ago

Ah, I see. Somehow I did not even know about the existence of std.bigint. If you need it ASAP, you can wrap it into a type of your own, and specify a custom serialiser, as per instructions in dpq/serialisation.d

Other than that, I will look into it this week.

bluebear94 commented 8 years ago

On second thought, there's still a bug with BigInt multiplication, so I'd probably stay with GMP.

bluebear94 commented 8 years ago

Maybe add GMP type serialization as a separate module?

IrenejMarc commented 8 years ago

As of right now, you can attach a custom serialiser to any type, so you can try jsut wrapping the GMP or BigInt types into something and write a serialiser of your own. Otherwise I'll do it during the week, if I finish the major ORM overhaul I am currently working on.

IrenejMarc commented 8 years ago

This is being worked on, should be released in a few days if I have enough time.