@@ -176,13 +176,21 @@ class Test(db.Model):
176176 age = db .IntegerProperty (default = 18 )
177177
178178
179- async def test_t291 (bind ):
179+ async def test_t291_t402 (bind ):
180180 from gino .dialects .asyncpg import JSON , JSONB
181181
182+ class CustomJSONB (db .TypeDecorator ):
183+ impl = JSONB
184+
185+ def process_result_value (self , * _ ):
186+ return 123
187+
182188 class PropsTest (db .Model ):
183189 __tablename__ = 'props_test_291'
184190 profile = db .Column (JSONB (), nullable = False , server_default = '{}' )
185191 profile1 = db .Column (JSON (), nullable = False , server_default = '{}' )
192+ profile2 = db .Column (CustomJSONB (),
193+ nullable = False , server_default = '{}' )
186194
187195 bool = db .BooleanProperty ()
188196 bool1 = db .BooleanProperty (prop_name = 'profile1' )
@@ -197,5 +205,10 @@ class PropsTest(db.Model):
197205 assert isinstance (profile , dict )
198206 profile1 = await bind .scalar ('SELECT profile1 FROM props_test_291' )
199207 assert isinstance (profile1 , dict )
208+ profile2 = await bind .scalar ('SELECT profile2 FROM props_test_291' )
209+ assert isinstance (profile2 , dict )
210+ custom_profile2 = await bind .scalar (PropsTest .select ('profile2' ))
211+ assert isinstance (custom_profile2 , int )
212+ assert custom_profile2 == 123
200213 finally :
201214 await PropsTest .gino .drop ()
0 commit comments