EDB
[ class tree: EDB ] [ index: EDB ] [ all elements ]

Class: EDB_PGSQL

Source Location: /EDB/EDB/EDB_PGSQL.php

Class Overview

EDB_Common
   |
   --EDB_PGSQL

PosgreSQL engine for EDB API


Methods


Inherited Variables

Inherited Methods

Class: EDB_Common

EDB_Common::bind_param()
replace bind parameters to parameter's value
EDB_Common::check_param()
Check parameter type and parameters
EDB_Common::file_exists()
Checks whether a file or directory exists
EDB_Common::get_param_number()
Get number of query parameters
EDB_Common::switch_freemark()
Change free marking

Class Details

[line 27]
PosgreSQL engine for EDB API

PostgreSQL 엔진을 위한 DB 추상 계층을 제공




[ Top ]


Class Methods


constructor __construct [line 106]

EDB_PGSQL __construct( string $hostname, string $user, string $password, string $database, object $options)

EDB_PGSQL 객체를 인스턴스화 하고 PostgreSQL 데이터베이스를 연결한다.

For examples:

  1.  $db new EDB_PGSQL ('pgsql://localhost''user''host''database');
  2.  $db new EDB_PGSQL ('pgsql://localhost:3306''user''host''database');
  3.  $db new EDB_PGSQL (
  4.            'pgsql:///var/run/postgresql',
  5.            'user''host''database'
  6.  );
  7.  $db new EDB_PGSQL (
  8.            'pgsql:///var/run/postgresql',
  9.            'user''host''database''options'
  10.  );

options parameter는 다음의 객체로 지정한다.

  1.  $o = (object) array (
  2.      'connect_timeout' => 2,
  3.      'options' => '--client_encoding=UTF8',
  4.      'sslmode' => 'prefer',
  5.      'requiressl' => 0,
  6.      'service' => ''
  7.  }

options 객체 멤버에 대해서는 http://www.postgresql.org/docs/8.3/static/libpq-connect.html를 참조하도록 한다.

만약 persistent connection을 사용하고 싶다면 host 앞에 'p~' prefix를 붙이면 된다.

For Examples:

  1.  $db new EDB_PGSQL ('pgsql://p~localhost''user''host''database');




Tags:

access:  public


Parameters:

string   $hostname   pgsql host[:port] 또는 unix socket 경로
string   $user   pgsql DB 계정
string   $password   pgsql DB 암호
string   $database   pgsql DB 이름
object   $options   pgsql 옵션

[ Top ]

destructor __destruct [line 613]

void __destruct( )



[ Top ]

method close [line 527]

void close( void 0)

Close the db handle



Tags:

access:  public


Parameters:

void   0  

[ Top ]

method escape [line 204]

string escape( string $buf, [ $type = 's'])

Escape special characters in a string for use in an SQL statement

Attention! This method always returns original string.




Tags:

access:  public


Parameters:

string   $buf   The string that is to be escaped.
   $type  

[ Top ]

method fetch [line 354]

object The fetch( [boolean $free = false])

Fetch a result row as an associative object



Tags:

return:  object of fetched a result row or false
access:  public


Parameters:

boolean   $free   (optional) fetch 수행 후 result를 free한다. (기본값: false) EDB >= 2.0.3

[ Top ]

method fetch_all [line 386]

array fetch_all( [boolean $free = true])

Fetch all result rows as an associative object



Tags:

return:  The fetched result rows
access:  public


Parameters:

boolean   $free   (optional) free result set after fetch. Defaluts is true.

[ Top ]

method field_name [line 432]

string|false field_name( integer $index)

Get the name of the specified field in a result



Tags:



Parameters:

integer   $index   Field number, starting from 0.

[ Top ]

method field_type [line 458]

string|false field_type( integer $index)

Returns the type name for the corresponding field number

returns a string containing the base type name of the given field_number in the given PostgreSQL result resource.




Tags:

access:  public


Parameters:

integer   $index   Field number, starting from 0.

[ Top ]

method free_result [line 406]

boolean free_result( void 0)

Frees stored result memory for the given statement handle



Tags:

access:  public


Parameters:

void   0  

[ Top ]

method get_charset [line 168]

string get_charset( )

Get character set of current database



Tags:

return:  Current character set name on DB
access:  public


[ Top ]

method lastId [line 319]

string|false lastId( )

가장 마지막 입력 row의 OID를 반환한다.



Tags:

since:  2.0.4
access:  public


[ Top ]

method num_fields [line 479]

integer|false num_fields( )

Returns the number of fields in a result



Tags:



[ Top ]

method query [line 256]

integer|false query( string $query, string $type, mixed $param1, mixed $param2,...)

Performs a query on the database



Tags:

return:  The number of affected rows
access:  public


Parameters:

string   $query   The query strings
string   $type   (optional) Bind parameter type. See also mysqli_stmt::bind_param.
  1.  => integer
  2.  => double
  3.  => string
  4.  => blob
mixed   $param1   (optional) Bind parameter 1
mixed   $param2,...   (optional) Bind parameter 2 ..

[ Top ]

method seek [line 332]

boolean seek( integer $offset)

Adjusts the result pointer to an arbitrary row in the result



Tags:

access:  public


Parameters:

integer   $offset   Must be between zero and the total number of rows minus one

[ Top ]

method set_charset [line 188]

bool set_charset( string $char)

Set character set of current database

Postgresql don't support set characterset and always returns true




Tags:

return:  always returns true
access:  public


Parameters:

string   $char   name of character set that supported from database

[ Top ]

method trend [line 513]

void trend( [bool $v = true])

DB transaction 을 종료한다.



Tags:

access:  public


Parameters:

bool   $v   false일경우 rollback을 수행한다.

[ Top ]

method trstart [line 500]

void trstart( )

DB transaction 을 시작한다.



Tags:

access:  public


[ Top ]


Documentation generated on Fri, 30 Aug 2024 06:10:17 +0900 by phpDocumentor 1.4.4