php-rql icon indicating copy to clipboard operation
php-rql copied to clipboard

Please support binary

Open lavvy opened this issue 7 years ago • 5 comments

In frontend apps like Php , we deal with images and graverters so much. Please could you add an inserting and retrieving of a binary data like image or graverter .

lavvy avatar Jan 30 '18 16:01 lavvy

What is a graveters ? Perhaps you should use base64 to encode images before inserting them into database.

Geekimo avatar Jan 30 '18 16:01 Geekimo

Oh wow am sorry I mean to say avatar. What am trying to achieve with Php is how it is achieved here on a png file on filesystem. https://www.rethinkdb.com/api/python/binary/

Meanwhile thanks for the prompt response cos I was scared if people are deserting rethinkdb (which I think, it's a thinking that came before it's time) On Jan 30, 2018 11:55 AM, "ABRAHAM Morgan" [email protected] wrote:

What is a graveters ? Perhaps you should use base64 to encode images before inserting them into database.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielmewes/php-rql/issues/159#issuecomment-361659266, or mute the thread https://github.com/notifications/unsubscribe-auth/AGsC4-g6qpmeoxy8ZOG-Bv1fPrbUHbj3ks5tP0mYgaJpZM4RyoZK .

lavvy avatar Jan 30 '18 18:01 lavvy

I'm still using it. Rdb is not dead. I pusheds a few PRs and I'm waiting them to be pushed to master.

According to http://danielmewes.dnsalias.net/~daniel/php-rql-api/, you have the r\binary method that looks the same as what you have in the python API.

Geekimo avatar Jan 30 '18 18:01 Geekimo

Don't know if I am the only one not seeing binary in that long list of apis . The closest insert I saw was this Example: Insert a document into the table posts.

r\table("posts")->insert(array( 'id' => 1, 'title' => "Lorem ipsum", 'content' => "Dolor sit amet" ))->run($conn)

And I am trying to figure out how to put a binary data in that query On Jan 30, 2018 1:54 PM, "ABRAHAM Morgan" [email protected] wrote:

I'm still using it. Rdb is not dead. I pusheds a few PRs and I'm waiting them to be pushed to master.

According to http://danielmewes.dnsalias.net/~daniel/php-rql-api/, you have the r\binary method that looks the same as what you have in the python API.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/danielmewes/php-rql/issues/159#issuecomment-361696509, or mute the thread https://github.com/notifications/unsubscribe-auth/AGsC473QsOpdawZXx-jVtEBo79p-RICSks5tP2V3gaJpZM4RyoZK .

lavvy avatar Jan 30 '18 20:01 lavvy

Replace your value with r\binary(file_get_contents('./myfile')) and that's it.

Geekimo avatar Jan 30 '18 20:01 Geekimo