<br><br><div class="gmail_quote">On Fri, Aug 27, 2010 at 8:10 AM, Panu Suominen <span dir="ltr"><<a href="mailto:panu.j.m.suominen@gmail.com">panu.j.m.suominen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Thank you for excelent feedback.<br></blockquote><div><br>thanks for your changes :)<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
2010/8/26 Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>>:<br>
<div class="im">> - I guess a lot of people doesn't need UTF (or other) encoding. And I guess<br>
> that the transformation brings some overhead in the query result mosty...(I<br>
> should run the benchmarks and see if there is difference). But I was<br>
> thinking if we could make this optional.<br>
<br>
</div>I was thinking that too. Apparently no encoding means that only 7bit<br>
characters should be used?<br>
<div class="im"><br></div></blockquote><div><br>I am totally newbie with encoding. I have no idea about how many bits hahah. The only thing I would like is that with "no encoding" I do what we were doing until this change. <br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
> or something like that....but the idea of making it optional not to have<br>
> overhead if not required, and being able to be enabled from the app code.<br>
<br>
</div>This probably need some thinking. Because if one uses database through<br>
GLORP the encoding parameter should be passed somehow to lower levels.<br></blockquote><div><br>Yes, I saw this after sending all the emails :(<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Would the ConnectionSettings in SqueakDBX level be right place? </blockquote><div><br>ahhhh yes, I forgot about ConnectionSettings :)<br>That sounds more reasonable than Connection.<br>FOr all your changes and comments it seems you understood SqueakDBX quite well and fast heheh<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">And in<br>
Glorp I think the platform level seems to be good. Then in Glorp one<br>
could express<br>
(Login new)<br>
database: (PostgreSQLPlatform withEncoding: #utf8);<br>
username: 'yyyyy';<br>
password: 'xxxx';<br>
connectString: 'host' , '_' , 'database'<br>
<br>
(PostgreSQLPlatform withEncoding: #utf8) would be short cut for<br>
(PostgreSQLPlatform new encoding: #utf8).<br>
<div class="im"><br>
<br>
> maybe we can just set again the NullEncoder in that case? or raise an error ? what do you think?<br>
<br>
</div>Yep, error checking code was not up to the task in the first try.<br>
Probably raise an error. Espesially if user has decided to use<br>
encoding (and data needs it). If<br>
code would continue silently with NullEncoder the data read would be corrupted.<br>
<div class="im"><br></div></blockquote><div><br>I agree. Raise an error with a really clear message.<br>I would like to add tests for this encoding stuff, if it makes sense. I try to keep tests updated and trying to cover most of the features.<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br>
> Ok.... I run the benchmarks and I was rigth<br>
<br>
</div>If I understood correctly berformance dropped over 10%. It is quite<br>
much. Have to see if that could be improved.<br></blockquote><div><br>If you want, you can try it by yourself:<br><br><a href="http://www.squeakdbx.org/Benchmarks">http://www.squeakdbx.org/Benchmarks</a><br><br>Easy, evaluate:<font color="#000000"><b><br>
<br>DBXBenchmark</b></font><font color="#000000"> </font><font color="#00007f">facility:</font><font color="#000000"> </font><font color="#000000"><b>DBXPostgreFacility</b></font><font color="#000000"> </font><font color="#00007f">facilityForBenchmark</font><font color="#000000">.</font><font color="#000000"><br>
<br></font><font color="#000000"><b>DBXTinyBenchmarks</b></font><font color="#000000"> </font><font color="#00007f">new</font><font color="#000000"> </font><font color="#00007f">runAll</font><font color="#000000">.</font><font color="#000000"><br>
</font><br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
> In addition, if someone has its own database using a particular encoding, and doesn't implement openConnection (that does the query, like you did in postgres) because he doesn't knwo, this<br>
> will be a problem beasue the database will have an encoding X and you will be encoding always with UTF8 ;)<br>
<br>
</div>This is a problem. However I do feel that encoding should be checked<br>
when database is connected (at least when user has selected that<br>
encoding should be used).<br></blockquote><div><br>yes, but only when the user has selected encoded <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Also endocoding should be property of the connection. If it would be<br>
class variable it would be impractical to connect to different<br>
databases with different encoding.<br>
<br></blockquote><div><br>you are right, sorry about that. <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I think one possibility to takle these problems would be<br>
EncoderFactory user passes to the code. This factory would set encoder<br>
in connection</blockquote><div><br>but weren't we going to put it in connectionSettings?<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
based either on the database query<br>
or by preselected value. The query option would ask the connection<br>
about encoding (using message encodingName or something like that). If<br>
connection cant<br>
handle the message then exception is raised (user chosed to<br>
automatically select encoding in setting where code is not up to the<br>
task).<br>
<br>
The preselected option would just set right encoder to the connection.<br>
I think that validation of this choice should be skipped because it<br>
would render this option to be basically the same than the automatic<br>
option. Preselected encoding could be NullEncoder.<br>
<br></blockquote><div><br>Uhh sorry, you lost me in this last paragraph. Maybe if I see the code I understand better :<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
If this sound sensible I will try to implement the changes in the<br>
weekend but cant promise I have the time. :)<br>
<br></blockquote><div><br>That would be cool, but don't worry, no stress.<br>BTW...just by curious. where/why are you trying to use SqueakDBX?<br><br>cheers<br><br>mariano<br></div></div><br>