21 declare(strict_types=1);
62 parent::__construct($send, $recv);
68 $sqlite =
new SQLite3($this->path);
69 $sqlite->busyTimeout(60000);
72 return $e->getMessage();
78 $stmt = $sqlite->prepare($query);
82 foreach($params as $paramName => $param){
83 $bind = $stmt->bindValue($paramName, $param);
88 $result = $stmt->execute();
89 if($result ===
false){
94 $ret =
new SqlResult();
99 $ret =
new SqlChangeResult($sqlite->changes());
104 $ret =
new SqlInsertResult($sqlite->changes(), $sqlite->lastInsertRowID());
111 for($i = 0, $iMax = $result->numColumns(); $i < $iMax; ++$i){
112 static $columnTypeMap = [
119 $colInfo[] =
new SqlColumnInfo($result->columnName($i), $columnTypeMap[$result->columnType($i)]);
125 if($value ===
"NAN"){
127 }elseif($value ===
"INF"){
129 }elseif($value ===
"-INF"){
137 $ret =
new SqlSelectResult($colInfo, $rows);
146 protected function close(&$resource) : void{
152 return __NAMESPACE__ .
" connector #$this->slaveNumber";
static createFactory(string $path)
executeQuery($resource, int $mode, string $query, array $params)
__construct(string $path, QuerySendQueue $send=null, QueryRecvQueue $recv=null)