Locale::MakePhrase::BackingStore::Database::PostgreSQL - Retrieve translations from a table within a PostgreSQL database.
This backing store is capable of loading language rules from a PostgreSQL table. See Locale::MakePhrase::BackingStore::Database for more information.
The PostgreSQL database instanc should be setup to use UNICODE as the text storage mechanism (ie: 'psql -l' should show you how the database instance was created).
The table structure can be created with the following PostgreSQL SQL statement:
CREATE TABLE some_table ( key TEXT, language TEXT, expression TEXT, priority INTEGER, translation TEXT );
This only differs from the generic database driver, in that TEXT is being used as a replacement for VARCHAR (both statements do the same thing).
The following methods are implemented:
[ Inherited from Locale::MakePhrase::BackingStore::Database. ]
Any options defined for in the base class, can be set here. ie: you could specify some of these options:
table
You must set this value.
dbh
owned
host
This module defaults to localhost unless it is defined.
port
This module defaults to 5432 unless it is defined.
user
This module defaults to an empty string.
password
connect_options
The default PostgreSQL connections options are:
RaiseError => 1 AutoCommit => 1 ChopBlanks => 1 pg_enable_utf8 => 1
If you set this value, you must supply a hash_ref supplying the appropriate PostgreSQL connection options.
Note that we set the AutoCommit simply because we only ever do SELECT's from the table, thus we never need to concern ourselves with aborted transations.
Notes: you must specify either the dbh option, or suitable connection options.
1 POD Error
The following errors were encountered while parsing the POD:
=cut found outside a pod block. Skipping to next block.
To install Locale::MakePhrase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::MakePhrase
CPAN shell
perl -MCPAN -e shell install Locale::MakePhrase
For more information on module installation, please visit the detailed CPAN module installation guide.