Forum Replies Created
-
AuthorPosts
-
DavidMember
My understanding is that the entire connection is encrypted using SSL when this is enabled. The MySQL server must have been compiled to support this option or it will not work. You can also set up X.509 based certificate authentication in addition to passwords, I believe.
Note that I have not done much with SSL in MySQL so I could be wrong, someone please correct me if this is the case!
DavidMemberOh yeah, I forgot to mention that in Perl you can also use alternate quote characters without HERE documents:
Code:print qq~
QUERY HERE
~;If you want to use single-quotes (the above does double-quote style interpolation):
Code:print q~
QUERY HERE
~;Note that you can use any character as the quote replacement (I use the tilde, ~ above), but you will have to backslash-escape this character in the string (but you won't have to escape the single or double quotes). So you could do this:
Code:print qq!
QUERY HERE
!;Make sure you use the same character at the beginning and end, and the q (single quote style) or qq (double-quote style) must also be present, as above.
DavidMemberPerl users could of course use HERE documents:
Code:print <<__ENDOFSQL__;
SELECT *
FROM testtable;
__ENDOFSQL__NOTE that this DOES do interpolation for everything other than the double-quote (it acts like a double-quoted string but double-quotes can be used in it without escaping). If you want it to act like a single-quoted string (no variable/other interpolation), do this:
Code:print <<'__ENDOFSQL__';
SELECT *
FROM testtable;Note the single-quotes around the EOD (end of document/data) marker, making it act like a single-quoted string, but you don't have to escape single quotes so often used in SQL!
DavidMemberThere could be a configuration in an options dialog as to which language you wanted to use (or some other selection method).
Many programming languages are similar, and many just require different quoting and concatenation characters (obviously some are a bit more subtle in their requirements). Perl uses double-quotes and periods for concatenation (changing in Perl 6 but don't worry about that for a while!) and VB uses double-quotes as well, but the ampersand (&) for concatenation. PHP's like Perl. Perl and PHP escape quotes in the string using backslashes, VB uses a doubled double-quote. I'm sure the programming to implement the quoting mechanism would be very simple…in fact the configuration could even just have three fields…quote escape character, quoting character, and concatenation operator, and let people set them to whatever works for their language.
Just my two cents…
-
AuthorPosts