In most databases (including MySQL), the DAL simply stores JSON in a text 
field and converts to and from Python objects when writing/reading the 
data. The Postgres adapter makes use of the Postgres native JSON field 
type, but the MySQL adapter does not yet do so.

Some options might be to convert the JSON field to a text field, define a 
DAL custom field type 
<http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types--experimental->,
 
or define filter_in/filter_out 
<http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#filter_in-and-filter_out>
 
functions. Or submit a pull request to support the MySQL JSON field type.

Anthony

On Thursday, June 29, 2017 at 9:10:16 AM UTC-4, narcissus wrote:
>
> Hi,
> I've created a database model containing a field of type json to access a 
> pre-existent MySQL database (created with mysql server version > 5.7.11) 
> containing the same field of type json into the same table.
> I cannot understand why the json data stored into the database are read 
> always as null by web2py DAL functions.
> This happens only when I access to MySQL database (ex: Postgres works). It 
> seems that no converter has been implemented for MySQL json field into 
> web2py DAL.
>
> Thanks in advanced for helping me
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to