gabordemooij / redbean

ORM layer that creates models, config and database on the fly
https://www.redbeanphp.com
2.3k stars 280 forks source link

is there some way to get bean or array with values with type same in DB? #863

Closed russeljo closed 3 years ago

russeljo commented 3 years ago

All methods descriped in docs return values in string type. Maybe i miss something, and there some way to get typed values? I use MySQL, maybe better use Postgres or smth else?

i found that: $mysqli->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE); How can i set it for R? at least for getAll()

I found that mysqlnd - return floats, integers

gabordemooij commented 3 years ago

PHP is a dynamically typed language, so you can just cast a string to a boolean or a number. Also, type systems between programming languages and database engines might not map perfectly. So I would recommend to just use the string values.