Class DbPgsql

Description

Pgsql数据库驱动类 感谢刘格 2007-12-29 完善^_^

首先请导入目录下面的pgsql.sql 文件

Located in /Think/Db/Driver/DbPgsql.class.php (line 25)

Base
   |
   --Db
      |
      --DbPgsql
Method Summary
DbPgsql __construct ([array $config = ''])
void close ()
boolen commit ()
void connect ([ $config = ''], [ $linkNum = 0])
string error ([ $result = true])
string escape_string (string $str)
void free ()
resultSet getAll ([ $sql = null], [string $resultType = null])
void getFields ( $tableName)
string getRow ([ $sql = null], [index $seek = 0], string $str)
void getTables ([ $dbName = ''])
boolen next ()
boolen rollback ()
void startTrans ()
integer _execute ([string $str = ''])
ArrayObject _query ([string $str = ''])
Variables
Methods
Constructor __construct (line 36)

架构函数 读取数据库配置信息

  • access: public
DbPgsql __construct ([array $config = ''])
  • array $config: 数据库配置数组

Redefinition of:
Db::__construct()
架构函数
close (line 405)

关闭数据库

  • throws: ThinkExecption
  • access: public
void close ()
commit (line 212)

用于非自动提交状态下面的查询提交

  • throws: ThinkExecption
  • access: public
boolen commit ()
connect (line 54)

连接数据库方法

  • throws: ThinkExecption
  • access: public
void connect ([ $config = ''], [ $linkNum = 0])
  • $config
  • $linkNum
error (line 426)

数据库错误信息

并显示当前的SQL语句

  • throws: ThinkExecption
  • access: public
string error ([ $result = true])
  • $result
escape_string (line 451)

SQL指令安全过滤

  • throws: ThinkExecption
  • access: public
string escape_string (string $str)
  • string $str: SQL指令
free (line 87)

释放查询结果

  • access: public
void free ()
getAll (line 330)

获得所有的查询数据

查询结果放到 resultSet 数组中

  • throws: ThinkExecption
  • access: public
resultSet getAll ([ $sql = null], [string $resultType = null])
  • string $resultType: 数据集类型
  • $sql
getFields (line 358)

取得数据表的字段信息

  • throws: ThinkExecption
  • access: public
void getFields ( $tableName)
  • $tableName
getRow (line 292)

获得一条查询结果

  • throws: ThinkExecption
  • access: public
string getRow ([ $sql = null], [index $seek = 0], string $str)
  • index $seek: 指针位置
  • string $str: SQL指令
  • $sql
getTables (line 387)

取得数据库的表信息

  • throws: ThinkExecption
  • access: public
void getTables ([ $dbName = ''])
  • $dbName
next (line 261)

获得下一条查询结果 简易数据集获取方法

查询结果放到 result 数组中

  • throws: ThinkExecption
  • access: public
boolen next ()
rollback (line 236)

事务回滚

  • throws: ThinkExecption
  • access: public
boolen rollback ()
startTrans (line 192)

启动事务

  • throws: ThinkExecption
  • access: public
void startTrans ()
_execute (line 144)

执行语句 针对 INSERT, UPDATE 以及DELETE

  • throws: ThinkExecption
  • access: protected
integer _execute ([string $str = ''])
  • string $str: sql指令
_query (line 106)

执行查询 主要针对 SELECT, SHOW 等指令

返回数据集

  • throws: ThinkExecption
  • access: protected
ArrayObject _query ([string $str = ''])
  • string $str: sql指令

Inherited Methods

Inherited From Db

Db::__construct()
Db::add()
Db::addAll()
Db::addConnect()
Db::addSpecialChar()
Db::autoExec()
Db::debug()
Db::execute()
Db::factory()
Db::fieldFormat()
Db::find()
Db::getDbType()
Db::getInstance()
Db::getLastSql()
Db::initConnect()
Db::isMainIps()
Db::lazyQuery()
Db::multiConnect()
Db::parseDSN()
Db::parseFields()
Db::parseGroup()
Db::parseHaving()
Db::parseJoin()
Db::parseLimit()
Db::parseOrder()
Db::parseSets()
Db::parseTables()
Db::parseValues()
Db::parseWhere()
Db::Q()
Db::query()
Db::remove()
Db::save()
Db::setDec()
Db::setField()
Db::setInc()
Db::setLockMode()
Db::switchConnect()
Db::W()

Documentation generated on Thu, 27 Mar 2008 08:20:39 +0000 by 塞北的雪