API:EPrints/Database/mysql

From EPrints Documentation
Revision as of 18:28, 11 August 2009 by Tdb01r (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki

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.

index_queue

 $db->index_queue( $datasetid, $objectid, $fieldname );

Queues the field of the specified object to be reindexed.

UNDOCUMENTED METHODS

Warning These methods were found in the source code but didn't have any POD associated with them. This may be because we haven't got around to documenting them yet or it could be because they are internal to the API and not intended for use by other parts of EPrints.

create_counter

drop_counter

get_primary_key

mysql_version_from_dbh

remove_counters