ensembl-hive  2.6
Bio::EnsEMBL::Hive::DBSQL::DBConnection Class Reference
+ Inheritance diagram for Bio::EnsEMBL::Hive::DBSQL::DBConnection:

Public Member Functions

public new ()
 
protected _optional_pair ()
 
public to_url_hash ()
 
public String url ()
 
public connect ()
 
public protected_prepare_execute ()
 
public to_cmd ()
 
public run_in_transaction ()
 
public Boolean has_write_access ()
 
public void requires_write_access ()
 
protected String _interval_seconds_sql ()
 
- Public Member Functions inherited from Bio::EnsEMBL::Hive::DBSQL::CoreDBConnection
public Bio::EnsEMBL::DBSQL::DBConnection new ()
 
public void connect ()
 
public Undef connected ()
 
public disconnect_count ()
 
public wait_timeout ()
 
public query_count ()
 
public Boolean equals ()
 
public String driver ()
 
public String port ()
 
public String dbname ()
 
public String username ()
 
public String user ()
 
public String host ()
 
public String hostname ()
 
public String password ()
 
public String pass ()
 
public Boolean disconnect_when_inactive ()
 
public Boolean reconnect_when_lost ()
 
public String locator ()
 
public DBI db_handle ()
 
public DBI prepare ()
 
public void reconnect ()
 
public Any work_with_db_handle ()
 
public void prevent_disconnect ()
 
public Boolean disconnect_if_idle ()
 
public do ()
 
public AUTOLOAD ()
 
public DESTROY ()
 
- Public Member Functions inherited from Bio::EnsEMBL::DBSQL::DBConnection
public Bio::EnsEMBL::DBSQL::DBConnection new ()
 
public void connect ()
 
public Undef connected ()
 
public disconnect_count ()
 
public timeout ()
 
public query_count ()
 
public Boolean equals ()
 
public String driver ()
 
public String port ()
 
public String dbname ()
 
public String username ()
 
public String user ()
 
public String host ()
 
public String hostname ()
 
public String password ()
 
public String pass ()
 
public Boolean disconnect_when_inactive ()
 
public Boolean reconnect_when_lost ()
 
public String locator ()
 
public DBI db_handle ()
 
public DBI prepare ()
 
public DBI prepare_cached ()
 
public void reconnect ()
 
public Result do ()
 
public Any work_with_db_handle ()
 
public void prevent_disconnect ()
 
public ArrayRef quote_identifier ()
 
public Boolean disconnect_if_idle ()
 
public SQLStatement add_limit_clause ()
 
public String from_date_to_seconds ()
 
public String from_seconds_to_date ()
 
public Bio::EnsEMBL::Utils::SqlHelper sql_helper ()
 
public Hash to_hash ()
 
protected _driver_object ()
 

Detailed Description

Synopsis

my $url = $dbc->url();

Description

    Extends the functionality of Bio::EnsEMBL::Hive::DBSQL::CoreDBConnection with things needed by the Hive

Definition at line 20 of file DBConnection.pm.

Member Function Documentation

◆ _interval_seconds_sql()

protected String Bio::EnsEMBL::Hive::DBSQL::DBConnection::_interval_seconds_sql ( )
  Argument[1] : String. Name of the column for the start of the interval
  Argument[2] : String, optional. Name of the column for the end of the interval
  Example     :
$self->dbc->_interval_seconds_sql();
  Description : Returns an SQL expression to compute the number of seconds betwen both columns.
                If the second column name is missing, compute the number of seconds until now instead.
  Returntype  : String
  Exceptions  : none
  Caller      : general
  Status      : Stable
 
Code:
click to view

◆ _optional_pair()

protected Bio::EnsEMBL::Hive::DBSQL::DBConnection::_optional_pair ( )

Undocumented method

Code:
click to view

◆ connect()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::connect ( )

Undocumented method

Code:
click to view

◆ has_write_access()

public Boolean Bio::EnsEMBL::Hive::DBSQL::DBConnection::has_write_access ( )
  Example     :
my $can_do = $dbc->has_write_access();
  Description : Tells whether the underlying database connection has write access to the database
  Returntype  : Boolean
  Exceptions  : none
  Caller      : general
  Status      : Stable
 
Code:
click to view

◆ new()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::new ( )

Undocumented method

Code:
click to view

◆ protected_prepare_execute()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::protected_prepare_execute ( )

Undocumented method

Code:
click to view

◆ requires_write_access()

public void Bio::EnsEMBL::Hive::DBSQL::DBConnection::requires_write_access ( )
  Example     :
$dbc->requires_write_access();
  Description : See Exceptions
  Returntype  : none
  Exceptions  : Throws if the current user hasn't write access to the database
  Caller      : general
  Status      : Stable
 
Code:
click to view

◆ run_in_transaction()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::run_in_transaction ( )
    Description : Wrapper that first sets AutoCommit to 0, runs some user code, and at the end issues a commit() / rollback()
                  It also has to temporarily set disconnect_when_inactive() to 1 because a value of 0 would cause the
                  DBConnection object to disconnect early, which would rollback the transaction.
                  NB: This is essentially a trimmed copy of Ensembl's Utils::SqlHelper::transaction()
 
Code:
click to view

◆ to_cmd()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::to_cmd ( )

Undocumented method

Code:
click to view

◆ to_url_hash()

public Bio::EnsEMBL::Hive::DBSQL::DBConnection::to_url_hash ( )

Undocumented method

Code:
click to view

◆ url()

public String Bio::EnsEMBL::Hive::DBSQL::DBConnection::url ( )
    Arg [1]    : String $environment_variable_name_to_store_password_in (optional)
    Example    :
$url = $dbc->url;
    Description: Constructs a URL string for this database connection.
    Returntype : string of format  mysql://<user>:<pass><host>:<port>/<dbname>
                               or  sqlite:///<dbname>
    Exceptions : none
    Caller     : general
 
Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Hive::DBSQL::DBConnection::run_in_transaction
public run_in_transaction()
Bio::EnsEMBL::Hive::Utils::URL::parse
public parse()
map
public map()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::_interval_seconds_sql
protected String _interval_seconds_sql()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::requires_write_access
public void requires_write_access()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::to_url_hash
public to_url_hash()
Bio::EnsEMBL::Hive::Utils::URL::hash_to_url
public A hash_to_url()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::protected_prepare_execute
public protected_prepare_execute()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::connect
public connect()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::_optional_pair
protected _optional_pair()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::to_cmd
public to_cmd()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::has_write_access
public Boolean has_write_access()
Bio::EnsEMBL::Hive::DBSQL::DBConnection::url
public String url()