2016-10-06 02:08:43 +00:00
|
|
|
<?php
|
2017-11-17 01:23:18 +00:00
|
|
|
/** @license MIT
|
|
|
|
* Copyright 2017 J. King, Dustin Wilson et al.
|
|
|
|
* See LICENSE and AUTHORS files for details */
|
|
|
|
|
2016-10-06 02:08:43 +00:00
|
|
|
declare(strict_types=1);
|
2017-03-28 04:12:12 +00:00
|
|
|
namespace JKingWeb\Arsse\Db;
|
2016-10-06 02:08:43 +00:00
|
|
|
|
|
|
|
interface Statement {
|
2017-04-07 01:41:21 +00:00
|
|
|
const TYPES = [
|
2019-03-01 17:17:33 +00:00
|
|
|
'int' => self::T_INTEGER,
|
|
|
|
'integer' => self::T_INTEGER,
|
|
|
|
'float' => self::T_FLOAT,
|
|
|
|
'double' => self::T_FLOAT,
|
|
|
|
'real' => self::T_FLOAT,
|
|
|
|
'numeric' => self::T_FLOAT,
|
|
|
|
'datetime' => self::T_DATETIME,
|
|
|
|
'timestamp' => self::T_DATETIME,
|
|
|
|
'blob' => self::T_BINARY,
|
|
|
|
'bin' => self::T_BINARY,
|
|
|
|
'binary' => self::T_BINARY,
|
|
|
|
'text' => self::T_STRING,
|
|
|
|
'string' => self::T_STRING,
|
|
|
|
'str' => self::T_STRING,
|
|
|
|
'bool' => self::T_BOOLEAN,
|
|
|
|
'boolean' => self::T_BOOLEAN,
|
2019-05-02 02:52:20 +00:00
|
|
|
'bit' => self::T_BOOLEAN,
|
2019-03-01 17:17:33 +00:00
|
|
|
'strict int' => self::T_NOT_NULL + self::T_INTEGER,
|
|
|
|
'strict integer' => self::T_NOT_NULL + self::T_INTEGER,
|
|
|
|
'strict float' => self::T_NOT_NULL + self::T_FLOAT,
|
|
|
|
'strict double' => self::T_NOT_NULL + self::T_FLOAT,
|
|
|
|
'strict real' => self::T_NOT_NULL + self::T_FLOAT,
|
|
|
|
'strict numeric' => self::T_NOT_NULL + self::T_FLOAT,
|
|
|
|
'strict datetime' => self::T_NOT_NULL + self::T_DATETIME,
|
|
|
|
'strict timestamp' => self::T_NOT_NULL + self::T_DATETIME,
|
|
|
|
'strict blob' => self::T_NOT_NULL + self::T_BINARY,
|
|
|
|
'strict bin' => self::T_NOT_NULL + self::T_BINARY,
|
|
|
|
'strict binary' => self::T_NOT_NULL + self::T_BINARY,
|
|
|
|
'strict text' => self::T_NOT_NULL + self::T_STRING,
|
|
|
|
'strict string' => self::T_NOT_NULL + self::T_STRING,
|
|
|
|
'strict str' => self::T_NOT_NULL + self::T_STRING,
|
|
|
|
'strict bool' => self::T_NOT_NULL + self::T_BOOLEAN,
|
|
|
|
'strict boolean' => self::T_NOT_NULL + self::T_BOOLEAN,
|
|
|
|
'strict bit' => self::T_NOT_NULL + self::T_BOOLEAN,
|
2017-04-07 01:41:21 +00:00
|
|
|
];
|
2019-03-01 17:17:33 +00:00
|
|
|
const T_INTEGER = 1;
|
|
|
|
const T_STRING = 2;
|
|
|
|
const T_BOOLEAN = 3;
|
|
|
|
const T_DATETIME = 4;
|
|
|
|
const T_FLOAT = 5;
|
|
|
|
const T_BINARY = 6;
|
|
|
|
const T_NOT_NULL = 100;
|
2017-03-02 19:19:16 +00:00
|
|
|
|
2017-08-29 14:50:31 +00:00
|
|
|
public function run(...$values): Result;
|
|
|
|
public function runArray(array $values = []): Result;
|
2017-12-30 22:04:21 +00:00
|
|
|
public function retype(...$bindings): bool;
|
|
|
|
public function retypeArray(array $bindings): bool;
|
2017-08-29 14:50:31 +00:00
|
|
|
}
|