Difference between revisions of "API:EPrints/Database/mysql"

From EPrints Documentation
Jump to: navigation, search
(New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
 
(Removing all content from page)
Line 1: Line 1:
<!-- Pod2Wiki=_preamble_
 
This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost.
 
-->{{Pod2Wiki}}{{API:Source|file=EPrints/Database/mysql.pm|package_name=EPrints::Database::mysql}}[[Category:API|mysql]]<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_name -->=NAME=
 
'''EPrints::Database::mysql''' - custom database methods for MySQL DB
 
  
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_description -->=DESCRIPTION=
 
MySQL database wrapper.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_mysql_specific_annoyances -->==MySQL-specific Annoyances==
 
MySQL does not support sequences.
 
 
MySQL is (by default) lax about truncation.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_methods -->=METHODS=
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_get_server_version -->==get_server_version==
 
 
  $version = $db-&gt;get_server_version
 
 
Return the database server version.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_create_counters -->==create_counters==
 
 
  $n = $db-&gt;create_counters()
 
 
Create and initialise the counters.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_has_table -->==has_table==
 
 
  $boolean = $db-&gt;has_table( $tablename )
 
 
Return true if the a table of the given name exists in the database.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_has_column -->==has_column==
 
 
  $boolean = $db-&gt;has_column( $tablename, $columnname )
 
 
Return true if the a table of the given name has a column named $columnname in the database.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_has_counter -->==has_counter==
 
 
  $success = $db-&gt;has_counter( $counter )
 
 
Returns true if $counter exists.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_counter_next -->==counter_next==
 
 
  $n = $db-&gt;counter_next( $counter )
 
 
Return the next unused value for the named counter. Returns undef if  the counter doesn't exist.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_counter_minimum -->==counter_minimum==
 
 
  $db-&gt;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.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_counter_reset -->==counter_reset==
 
 
  $db-&gt;counter_reset( $counter )
 
 
Return the counter. Use with cautiuon.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_index_queue -->==index_queue==
 
 
  $db-&gt;index_queue( $datasetid, $objectid, $fieldname );
 
 
Queues the field of the specified object to be reindexed.
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS=
 
{{API:Undocumented Methods}}<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_create_counter -->==create_counter==
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_drop_counter -->==drop_counter==
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_get_primary_key -->==get_primary_key==
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_mysql_version_from_dbh -->==mysql_version_from_dbh==
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=item_remove_counters -->==remove_counters==
 
 
<!-- End of Pod2Wiki -->
 
<!-- Pod2Wiki=_postamble_ --><!-- End of Pod2Wiki -->
 

Revision as of 15:39, 12 August 2009