pg: Minor docs + tests

This commit is contained in:
Yorhel 2025-02-13 08:50:40 +01:00
parent 867543267f
commit d5401674f9
3 changed files with 31 additions and 1 deletions

View file

@ -105,6 +105,15 @@ Connection is dead or otherwise unusable.
Set the default settings for new statements created with B<< $conn->q() >>.
=item B<< $conn->cache_size($num) >>
Set the number of prepared statements to keep in the cache. Defaults to 256.
Setting this (temporarily) to 0 will immediately reclaim all cached statements.
Prepared statements that still have an active C<$st> object are not counted
towards this number. The cache works as an LRU: when it's full, the statement
that hasn't been used for the longest time is reclaimed.
=item B<< $conn->disconnect >>
Close the connection. Any active transactions are rolled back and any further
@ -455,7 +464,7 @@ as well. Much older versions will certainly not work fine.
=item * Only supports the UTF-8 encoding for all text strings sent to and
received from the PostgreSQL server. The encoding is assumed to be UTF-8 by
default, but if this may not be the case in your situation, setting
`client_encoding=utf8` as part of the connection string or manually switching
C<client_encoding=utf8> as part of the connection string or manually switching
to it after C<connect()> is always safe:
my $conn = FU::Pg->connect('');