File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636 time64_noday_io
3737 long-long based time I/O with noday-intervals.
3838"""
39+ import uuid
3940import warnings
4041import codecs
4142from ..encodings import aliases as pg_enc_aliases
@@ -266,6 +267,13 @@ def circle_unpack(x):
266267 x = ts .circle_unpack (x )
267268 return pg_types .circle (((x [0 ], x [1 ]), x [2 ]))
268269
270+ def uuid_pack (x ):
271+ if isinstance (x , uuid .UUID ):
272+ return x .bytes
273+ return uuid .UUID (x ).bytes
274+ def uuid_unpack (x ):
275+ return uuid .UUID (bytes = x )
276+
269277##
270278# numeric is represented using:
271279# ndigits, the number of *numeric* digits.
@@ -419,6 +427,8 @@ def numeric_unpack(x):
419427 pg_types .BOXOID : (box_pack , box_unpack ),
420428 pg_types .LSEGOID : (lseg_pack , lseg_unpack ),
421429 pg_types .CIRCLEOID : (circle_pack , circle_unpack ),
430+
431+ pg_types .UUIDOID : (uuid_pack , uuid_unpack ),
422432}
423433
424434oid_to_io [pg_types .CIDROID ] = (None , None )
Original file line number Diff line number Diff line change 1010import time
1111import datetime
1212import decimal
13+ import uuid
1314from itertools import chain , islice
1415from operator import itemgetter
1516
268269 pg_types .varbit ('010111101111' ),
269270 ],
270271 ),
272+ ('uuid' , [
273+ uuid .uuid1 (),
274+ ],
275+ ),
271276]
272277
273278if False :
You can’t perform that action at this time.
0 commit comments