Serenity: JsonField<Type>

Created on 5 Sep 2019  路  8Comments  路  Source: serenity-is/Serenity

Dear @volkanceylan
Please consider to add a new field type called JsonField
To work with JSON strings stored in the database.

Currently, I am using StringField and parsing the JSON to a certain type.
It will be nice to have JsonField which will handle these parse and stringify things.

FYI
https://docs.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?view=sql-server-2017

Most helpful comment

OK, nice idea, i'll consider this, just can't do it specific to SQL server, but agree it should handle serialize / deserialize

All 8 comments

@dfaruque which library (js/ts) are you using to display json content in form ?

@kilroyFR I have used Serenity's PropertyGrid and slightly customized GridEditor.ts

@dfaruque ,

it's probably not the full blown solution you are suggesting - but could this here help solving your issue? https://radekmaziarka.pl/2018/01/22/dapper-json-type-custom-mapper/

John

OK, nice idea, i'll consider this, just can't do it specific to SQL server, but agree it should handle serialize / deserialize

Thanks, I have mentioned the SQL server for example. Many database engines have such a feature nowadays.

BTW, handling serialize/deserialize will be enough.

There is a JsonField type now.

@volkanceylan how I can use JsonField type to write data to postgres database to column with type 'json'?
Where can I find an example?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kilroyFR picture kilroyFR  路  3Comments

Shraddha996 picture Shraddha996  路  3Comments

chintankukadiya18 picture chintankukadiya18  路  3Comments

JohnRanger picture JohnRanger  路  3Comments

dkontod picture dkontod  路  3Comments