… | |
… | |
44 | use DBI (); |
44 | use DBI (); |
45 | |
45 | |
46 | BEGIN { |
46 | BEGIN { |
47 | use base qw(Exporter DynaLoader); |
47 | use base qw(Exporter DynaLoader); |
48 | |
48 | |
49 | $VERSION = 0.131; |
49 | $VERSION = 0.143; |
50 | @EXPORT = qw( |
50 | @EXPORT = qw( |
51 | sql_exec sql_fetch sql_fetchall sql_exists sql_insertid $sql_exec |
51 | sql_exec sql_fetch sql_fetchall sql_exists sql_insertid $sql_exec |
52 | sql_uexec sql_ufetch sql_ufetchall sql_uexists |
52 | sql_uexec sql_ufetch sql_ufetchall sql_uexists |
53 | ); |
53 | ); |
54 | @EXPORT_OK = qw( |
54 | @EXPORT_OK = qw( |
… | |
… | |
232 | ... and it's still quite fast unless you fetch large amounts of data. |
232 | ... and it's still quite fast unless you fetch large amounts of data. |
233 | |
233 | |
234 | C<sql_ufetch> is similar to C<sql_fetch> but upgrades all input values to |
234 | C<sql_ufetch> is similar to C<sql_fetch> but upgrades all input values to |
235 | utf8 and forces all result values to utf8 (this does I<not> include result |
235 | utf8 and forces all result values to utf8 (this does I<not> include result |
236 | parameters, only return values. Using bind variables in cinjunction with |
236 | parameters, only return values. Using bind variables in cinjunction with |
237 | sql_u* functions results in undefined behaviour). |
237 | sql_u* functions results in undefined behaviour - we use utf8_on on |
|
|
238 | bind-variables and it seems to work on DBD::mysql which just means |
|
|
239 | that that DBD-driver is broken). |
238 | |
240 | |
239 | =item sql_fetchall <see sql_exec> |
241 | =item sql_fetchall <see sql_exec> |
240 | |
242 | |
241 | =item sql_ufetchall <see sql_uexec> |
243 | =item sql_ufetchall <see sql_uexec> |
242 | |
244 | |
… | |
… | |
318 | |
320 | |
319 | =item [old-size] = cachesize [new-size] |
321 | =item [old-size] = cachesize [new-size] |
320 | |
322 | |
321 | Returns (and possibly changes) the LRU cache size used by C<sql_exec>. The |
323 | Returns (and possibly changes) the LRU cache size used by C<sql_exec>. The |
322 | default is somewhere around 50 (= the 50 last recently used statements |
324 | default is somewhere around 50 (= the 50 last recently used statements |
323 | will be cached). It shouldn't be too large, since a simple linear listed |
325 | will be cached). It shouldn't be too large, since a simple linear list |
324 | is used for the cache at the moment (which, for small (<100) cache sizes |
326 | is used for the cache at the moment (which, for small (<100) cache sizes |
325 | is actually quite fast). |
327 | is actually quite fast). |
326 | |
328 | |
327 | The function always returns the cache size in effect I<before> the call, |
329 | The function always returns the cache size in effect I<before> the call, |
328 | so, to nuke the cache (for example, when a database connection has died |
330 | so, to nuke the cache (for example, when a database connection has died |
… | |
… | |
416 | |
418 | |
417 | Return the login name. |
419 | Return the login name. |
418 | |
420 | |
419 | =item $db->password |
421 | =item $db->password |
420 | |
422 | |
421 | Return the password (emphasizing the fact that the apssword is stored plaintext ;) |
423 | Return the password (emphasizing the fact that the password is stored plaintext ;) |
422 | |
424 | |
423 | =cut |
425 | =cut |
424 | |
426 | |
425 | sub dsn($) { |
427 | sub dsn($) { |
426 | my $self = shift; |
428 | my $self = shift; |