COLLATE UNICODE or COLLATE LOCALIZED in sqlite using DAL

1,091 views
Skip to first unread message

Junior Phanter

unread,
Jun 1, 2018, 11:43:45 AM6/1/18
to web...@googlegroups.com
how set COLLATE UNICODE or COLLATE LOCALIZED in sqlite using DAL?

When I am ordering sharp words, I want him to ignore the accents. I was saving using compute field, names without accent and uppercase to be able to sort, but then db size increases, an alternative would be to sort () doing this change in execution, but in this way I lose performance and practicality, so wanted to know if you have set COLLATE UNICODE or COLLATE LOCALIZED using DAL. That is, the DAL generates the following SQL:

SELECT * FROM foo ORDER BY to COLLATE UNICODE

Anthony

unread,
Jun 1, 2018, 12:04:47 PM6/1/18
to web2py-users
You can execute arbitrary SQL via db.executesql(), but I don't think there is an easy way to add the collate expression to a standard DAL-generated query (you could generate a SQL string via the ._select() method and then manipulate it and ultimately pass it to db.executesql()).

Would it make more sense to define the collation behavior of the column directly in the SQLite schema so you don't have to worry about specifying it on a per-query basis (or do you sometimes want different collation behavior for this particular column)?

Anthony

Junior Phanter

unread,
Jun 1, 2018, 12:53:35 PM6/1/18
to web...@googlegroups.com
Thank you Antony. I'm trying to use executesql.

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Junior Phanter

unread,
Jun 1, 2018, 1:12:37 PM6/1/18
to web...@googlegroups.com
The best solution using SQLITE that I found for my problem
Reply all
Reply to author
Forward
0 new messages