Is it Glorp trustful enough for the encoding?
Hi guys. It may happen that both, Glorp and the database driver in question, support an encoding strategy. In Pharo, both drivers (NativePostgresDriver and OpenDBXDriver) does support setting an encoding and take care of it. But Glorp supports that as well. I want to avoid doing double conversion... So...where should I do the conversion? At Glorp level or at database driver level? Is glorp trustful enough for the encoding? UserGuide says nothing about it. Thanks, -- Mariano http://marianopeck.wordpress.com
On 10 Jul 2013, at 17:00, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi guys. It may happen that both, Glorp and the database driver in question, support an encoding strategy. In Pharo, both drivers (NativePostgresDriver and OpenDBXDriver) does support setting an encoding and take care of it. But Glorp supports that as well. I want to avoid doing double conversion...
So...where should I do the conversion? At Glorp level or at database driver level? Is glorp trustful enough for the encoding? UserGuide says nothing about it.
It should certainly only happen once ! And IMHO at the lowest possible level. If you have an SQL VARCHAR column, the driver should convert bytes to a normal Smalltalk String. An OR mapper is a client of the driver, right ?
Thanks,
-- Mariano http://marianopeck.wordpress.com
2013/7/10 Sven Van Caekenberghe <sven@stfx.eu>:
So...where should I do the conversion? At Glorp level or at database driver level?
And IMHO at the lowest possible level. If you have an SQL VARCHAR column, the driver should convert bytes to a normal Smalltalk String. An OR mapper is a client of the driver, right ?
+1 Encoding should be a parameter of the Connection/Login details. And ORM should deal only with strings in whatever encoding Pharo uses for its strings, ignoring (as much as possible) what happens beneath. Regards,
I agree with you guys. So, I fixed something in the GlorpNativePostgresDriver so that it gets the encoding info from Glorp's Login and pass it to the PGConnectionArgs :) Cheers, On Wed, Jul 10, 2013 at 12:16 PM, Esteban A. Maringolo <emaringolo@gmail.com
wrote:
2013/7/10 Sven Van Caekenberghe <sven@stfx.eu>:
So...where should I do the conversion? At Glorp level or at database driver level?
And IMHO at the lowest possible level. If you have an SQL VARCHAR column, the driver should convert bytes to a normal Smalltalk String. An OR mapper is a client of the driver, right ?
+1
Encoding should be a parameter of the Connection/Login details. And ORM should deal only with strings in whatever encoding Pharo uses for its strings, ignoring (as much as possible) what happens beneath.
Regards,
-- Mariano http://marianopeck.wordpress.com
participants (3)
-
Esteban A. Maringolo -
Mariano Martinez Peck -
Sven Van Caekenberghe