-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added strict mode and fetch mode for Mysql client (swoft-cloud/…
…swoft-component#208) * 增加DB严格模式配置 * 增加配置读取单测 * Update SqlTest.php * Update DbPoolProperties.php * Remoe useless comments.
- Loading branch information
1 parent
a61928c
commit bd44c19
Showing
10 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,6 @@ | |
|
||
/** | ||
* The pool properties of database | ||
* | ||
* @uses DbPoolProperties | ||
* @version 2018年01月27日 | ||
* @author stelin <[email protected]> | ||
* @copyright Copyright 2010-2016 swoft software | ||
* @license PHP Version 7.x {@link http://www.php.net/license/3_0.txt} | ||
*/ | ||
class DbPoolProperties extends PoolProperties | ||
{ | ||
|
@@ -31,10 +25,32 @@ class DbPoolProperties extends PoolProperties | |
protected $driver = Driver::MYSQL; | ||
|
||
/** | ||
* @return string | ||
* 开启严格模式,返回的字段将自动转为数字类型 | ||
* | ||
* @var bool | ||
*/ | ||
protected $strictType = false; | ||
|
||
/** | ||
* 开启 Fetch 模式, 可类似于 PDO 一样使用 fetch/fetchAll 逐行获取或获取全部结果集 | ||
* | ||
* @since Swoole 4.0 | ||
* @var bool | ||
*/ | ||
protected $fetchMode = true; | ||
|
||
public function getDriver(): string | ||
{ | ||
return $this->driver; | ||
} | ||
|
||
public function isStrictType(): bool | ||
{ | ||
return $this->strictType; | ||
} | ||
|
||
public function isFetchMode(): bool | ||
{ | ||
return $this->fetchMode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters