Data types

Table of contents

Type mapping

Returned values

When returning values, this driver maps CrateDB types to native PHP types:

CrateDB Type

PHP Type

boolean

boolean

byte

short

integer

integer

integer

long

integer

float

float

double

float

string

string

ip

string

timestamp

integer

geo_point

array

geo_shape

object

object

object

array

array

Query values

When using values in a query, you must bind them to a PDO parameter class constant, using either bindParam() or bindValue().

We recommend the following bindings:

CrateDB Type

PDO Type

boolean

PDO::PARAM_BOOL

byte,

short,

PDO::PARAM_INT

integer

PDO::PARAM_INT

long

PDO::PARAM_LONG

float,

PDO::PARAM_FLOAT

double

PDO::PARAM_DOUBLE

string

PDO::PARAM_STR

ip

PDO::PARAM_STR

timestamp

PDO::PARAM_TIMESTAMP

geo_point

PDO::PARAM_ARRAY

geo_shape

PDO::PARAM_OBJECT

object

PDO::PARAM_OBJECT

array

PDO::PARAM_ARRAY

Feedback

How helpful was this page?