Hook to inject encoding into Glorp

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Hook to inject encoding into Glorp

jtuchel
Dear Glorp experts,

I'll try o make a long story short:I am chewing on this crazy idea to switch from one database (db2) to another one (postgresql), going from VA Smalltalk 32 bits to 64. Let's say this is more a business decision than a technical one.

Once I do the switch, I might as well go and transform all my Strings in the database from ISO-8859-1(5) to UTF-8. The complicated thing here is that, in its current version, VA Smalltalk is not (yet) using utf-8 internally. So what would be needed (at least temoorarily until VAST supports UTF-8 natively) is some form of encoding/decoding whenever data travels between the databse and Glorp, resp, the image. My naive idea here would be that whenever we send out an SQL statement to the DB and whenever something comes back from the DB, we just convert the Strings from/to utf-8.

I wonder about a few things here:
  1. is this a job that Glorp would provide a hook or even some functionality for? Or should I be lloking at the underlying Database Interface classes?
  2. How do people calculate their CHAR and VARCHAR sizes for utf-8? A straight "number of characters times 4" sounds a bit much, at least for German, because we only have a hand full of special characters and our words contain quite a few ascii letters...
  3. Has anybody done a database migration using Glorp? Any tips for ready for sharing? Recommendations for tools to do the migration? I need Sequences to be consecutive on the new database and need to port triggers and stored procs along with the data...
So if any of you happen to have ideas on one or more of these topics and has a few ideas, caveats, heads up to share, I'd be grateful. And I am sure there are more people on this planet who'd like to learn about them...

Joachim

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Hook to inject encoding into Glorp

Mariano Martinez Peck
Hi Joachim,

I don't know what's the situation in VW, but when we did the port to Pharo long ago I think we added support for #encodingStrategy: into the Login class. 
You may want to look into Pharo mailing list for the string "encodingStrategy:". Then, you could load Glorp on Pharo and see where it is used. That might give you a sense of the involved parts...

Best, 



On Fri, Nov 23, 2018 at 5:00 AM jtuchel <[hidden email]> wrote:
Dear Glorp experts,

I'll try o make a long story short:I am chewing on this crazy idea to switch from one database (db2) to another one (postgresql), going from VA Smalltalk 32 bits to 64. Let's say this is more a business decision than a technical one.

Once I do the switch, I might as well go and transform all my Strings in the database from ISO-8859-1(5) to UTF-8. The complicated thing here is that, in its current version, VA Smalltalk is not (yet) using utf-8 internally. So what would be needed (at least temoorarily until VAST supports UTF-8 natively) is some form of encoding/decoding whenever data travels between the databse and Glorp, resp, the image. My naive idea here would be that whenever we send out an SQL statement to the DB and whenever something comes back from the DB, we just convert the Strings from/to utf-8.

I wonder about a few things here:
  1. is this a job that Glorp would provide a hook or even some functionality for? Or should I be lloking at the underlying Database Interface classes?
  2. How do people calculate their CHAR and VARCHAR sizes for utf-8? A straight "number of characters times 4" sounds a bit much, at least for German, because we only have a hand full of special characters and our words contain quite a few ascii letters...
  3. Has anybody done a database migration using Glorp? Any tips for ready for sharing? Recommendations for tools to do the migration? I need Sequences to be consecutive on the new database and need to port triggers and stored procs along with the data...
So if any of you happen to have ideas on one or more of these topics and has a few ideas, caveats, heads up to share, I'd be grateful. And I am sure there are more people on this planet who'd like to learn about them...

Joachim

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.


--

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Hook to inject encoding into Glorp

jtuchel
Hi Mariano,

hmmm. There is DatabasePlatform>>#characterEncoding: but that seems not to be exactly what I'd want to use... Not sure what exactly it does ;-)

Thanks for your suggestion on looking into Pharo. Will do as soon as I find the time...


Joachim


Am 23.11.18 um 16:10 schrieb Mariano Martinez Peck:
Hi Joachim,

I don't know what's the situation in VW, but when we did the port to Pharo long ago I think we added support for #encodingStrategy: into the Login class. 
You may want to look into Pharo mailing list for the string "encodingStrategy:". Then, you could load Glorp on Pharo and see where it is used. That might give you a sense of the involved parts...

Best, 



On Fri, Nov 23, 2018 at 5:00 AM jtuchel <[hidden email]> wrote:
Dear Glorp experts,

I'll try o make a long story short:I am chewing on this crazy idea to switch from one database (db2) to another one (postgresql), going from VA Smalltalk 32 bits to 64. Let's say this is more a business decision than a technical one.

Once I do the switch, I might as well go and transform all my Strings in the database from ISO-8859-1(5) to UTF-8. The complicated thing here is that, in its current version, VA Smalltalk is not (yet) using utf-8 internally. So what would be needed (at least temoorarily until VAST supports UTF-8 natively) is some form of encoding/decoding whenever data travels between the databse and Glorp, resp, the image. My naive idea here would be that whenever we send out an SQL statement to the DB and whenever something comes back from the DB, we just convert the Strings from/to utf-8.

I wonder about a few things here:
  1. is this a job that Glorp would provide a hook or even some functionality for? Or should I be lloking at the underlying Database Interface classes?
  2. How do people calculate their CHAR and VARCHAR sizes for utf-8? A straight "number of characters times 4" sounds a bit much, at least for German, because we only have a hand full of special characters and our words contain quite a few ascii letters...
  3. Has anybody done a database migration using Glorp? Any tips for ready for sharing? Recommendations for tools to do the migration? I need Sequences to be consecutive on the new database and need to port triggers and stored procs along with the data...
So if any of you happen to have ideas on one or more of these topics and has a few ideas, caveats, heads up to share, I'd be grateful. And I am sure there are more people on this planet who'd like to learn about them...

Joachim

--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.


--
--
You received this message because you are subscribed to a topic in the Google Groups "glorp-group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glorp-group/9y56uTlmkWE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "glorp-group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/glorp-group.
For more options, visit https://groups.google.com/d/optout.