Difference between revisions of "API:EPrints/Database/mysql"
(Removing all content from page) |
|||
Line 1: | Line 1: | ||
+ | <!-- Pod2Wiki=_preamble_ | ||
+ | This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost. | ||
+ | -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Database/mysql.pm|package_name=EPrints::Database::mysql}}[[Category:API|mysql]]<div><!-- Edit below this comment --> | ||
+ | |||
+ | <!-- Pod2Wiki=_private_ --><!-- Pod2Wiki=head_name --> | ||
+ | ==NAME== | ||
+ | '''EPrints::Database::mysql''' - custom database methods for MySQL DB | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_description --> | ||
+ | ==DESCRIPTION== | ||
+ | MySQL database wrapper. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_mysql_specific_annoyances --> | ||
+ | ===MySQL-specific Annoyances=== | ||
+ | MySQL does not support sequences. | ||
+ | |||
+ | MySQL is (by default) lax about truncation. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=head_methods --> | ||
+ | ==METHODS== | ||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_get_server_version --> | ||
+ | ===get_server_version=== | ||
+ | |||
+ | $version = $db->get_server_version | ||
+ | Return the database server version. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_create_counters --> | ||
+ | ===create_counters=== | ||
+ | |||
+ | $n = $db->create_counters() | ||
+ | Create and initialise the counters. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_has_table --> | ||
+ | ===has_table=== | ||
+ | |||
+ | $boolean = $db->has_table( $tablename ) | ||
+ | Return true if the a table of the given name exists in the database. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_has_column --> | ||
+ | ===has_column=== | ||
+ | |||
+ | $boolean = $db->has_column( $tablename, $columnname ) | ||
+ | Return true if the a table of the given name has a column named $columnname in the database. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_has_counter --> | ||
+ | ===has_counter=== | ||
+ | |||
+ | $success = $db->has_counter( $counter ) | ||
+ | Returns true if $counter exists. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_counter_next --> | ||
+ | ===counter_next=== | ||
+ | |||
+ | $n = $db->counter_next( $counter ) | ||
+ | Return the next unused value for the named counter. Returns undef if the counter doesn't exist. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_counter_minimum --> | ||
+ | ===counter_minimum=== | ||
+ | |||
+ | $db->counter_minimum( $counter, $value ) | ||
+ | Ensure that the counter is set no lower that $value. This is used when importing eprints which may not be in scrict sequence. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=item_counter_reset --> | ||
+ | ===counter_reset=== | ||
+ | |||
+ | $db->counter_reset( $counter ) | ||
+ | Return the counter. Use with cautiuon. | ||
+ | |||
+ | <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> | ||
+ | <span style='display:none'>User Comments</span> | ||
+ | <!-- Edit below this comment --> | ||
+ | |||
+ | |||
+ | <!-- Pod2Wiki= --> | ||
+ | </div> | ||
+ | <!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment --> |
Revision as of 13:26, 25 February 2010
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::Database::mysql - custom database methods for MySQL DB
DESCRIPTION
MySQL database wrapper.
MySQL-specific Annoyances
MySQL does not support sequences.
MySQL is (by default) lax about truncation.
METHODS
get_server_version
$version = $db->get_server_version
Return the database server version.
create_counters
$n = $db->create_counters()
Create and initialise the counters.
has_table
$boolean = $db->has_table( $tablename )
Return true if the a table of the given name exists in the database.
has_column
$boolean = $db->has_column( $tablename, $columnname )
Return true if the a table of the given name has a column named $columnname in the database.
has_counter
$success = $db->has_counter( $counter )
Returns true if $counter exists.
counter_next
$n = $db->counter_next( $counter )
Return the next unused value for the named counter. Returns undef if the counter doesn't exist.
counter_minimum
$db->counter_minimum( $counter, $value )
Ensure that the counter is set no lower that $value. This is used when importing eprints which may not be in scrict sequence.
counter_reset
$db->counter_reset( $counter )
Return the counter. Use with cautiuon.