DAL MySQL text type

79 views
Skip to first unread message

Carlos Cesar Caballero Díaz

unread,
Aug 16, 2018, 12:59:13 PM8/16/18
to web...@googlegroups.com
Hi guys, what kind of data type uses pydal in MySQL for "text" type?, if
it is TEXT, is possible to set it for using MEDIUMTEXT or LONGTEXT?


Greetings.


Erik

unread,
Aug 17, 2018, 11:35:01 PM8/17/18
to web2py-users

Carlos Cesar Caballero Díaz

unread,
Aug 18, 2018, 3:49:35 PM8/18/18
to web...@googlegroups.com

Hi, Erick, thanks for your answer, there are the DAL types and the default validators, but there are no mention about the adapters field types, for example, in MySQL text can be stored in fields of types TEXT, MEDIUMTEXT or LONGTEXT. I am asking for the type used in the MySQL DB, and if is possible to set a different one.

Greetings.


El 17/08/18 a las 23:35, Erik escribió:
--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Aug 18, 2018, 5:48:29 PM8/18/18
to web...@googlegroups.com
The DAL uses LONGTEXT for text fields in MySQL (see https://github.com/web2py/pydal/blob/master/pydal/dialects/mysql.py#L15). If you'd like to use an alternative, you can create a custom type via SQLCustomType: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types-experimental-.

Anthony
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscribe@googlegroups.com.

Carlos Cesar Caballero Díaz

unread,
Aug 20, 2018, 2:41:22 PM8/20/18
to web...@googlegroups.com

Thanks Anthony, LONGTEXT is exactly what I need. But in case of necessity, how "experimental" is that feature? Should I be worried about unnoticed API changes?.

Greetings.


El 18/08/18 a las 17:48, Anthony escribió:
The DAL uses LONGTEXT for text fields in MySQL. If you'd like to use an alternative, you can create a custom type via SQLCustomType: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Custom-Field-types-experimental-.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.

Anthony

unread,
Aug 20, 2018, 3:49:36 PM8/20/18
to web2py-users
On Monday, August 20, 2018 at 2:41:22 PM UTC-4, Carlos Cesar Caballero wrote:

Thanks Anthony, LONGTEXT is exactly what I need. But in case of necessity, how "experimental" is that feature? Should I be worried about unnoticed API changes?.


It's not really experimental (been there for years) -- it's just that no one ever updated that heading in the book. I just pushed a commit to the book repo removing "experimental".

Anthony

Carlos Cesar Caballero Díaz

unread,
Aug 21, 2018, 11:24:05 AM8/21/18
to web...@googlegroups.com

Great, Thanks!!


El 20/08/18 a las 15:49, Anthony escribió:
Reply all
Reply to author
Forward
0 new messages