Giter VIP home page Giter VIP logo

Comments (4)

tbolier avatar tbolier commented on May 28, 2024

Hi @mpjraaij

Before you execute the query, please execute $r->connection()->connect();

The fatal error that caused your error is related to not having connected first, so there is no open stream.

I have updated the code, to throw a proper ConnectionException in that case. I've also updated the documentation which was missing the $r->connection()->connect(); reference.

Thanks for reporting this.
You can immediately fix your issue with your current version of the library by connecting first.

Let me know if that sorted it for you?

Cheers

from php-rethink-ql.

tbolier avatar tbolier commented on May 28, 2024

This issue has been resolved.

from php-rethink-ql.

factormaarten avatar factormaarten commented on May 28, 2024

Thanks!

That did not fully solve it. To test I'm now using this code:

$r = new Rethink($registry->getConnection('default'));
$r->connection()->connect();
$r->db()
  ->tableCreate('test')
  ->run();

I'm getting a Runtime Error:

PHP Fatal error:  Uncaught TBolier\RethinkQL\Connection\ConnectionException: Runtime error: U, jsonQuery: [1,[60,[[1,"test"]]],{"db":[14,["vagrant"]]}] in/code/vendor/tbolier/php-rethink-ql/src/Connection/Connection.php:372
Stack trace:
#0 /code/vendor/tbolier/php-rethink-ql/src/Connection/Connection.php(334): TBolier\RethinkQL\Connection\Connection->validateResponse(Object(TBolier\RethinkQL\Response\Response), 820726866, 820726866, Object(TBolier\RethinkQL\Message\Message))
#1 /code/vendor/tbolier/php-rethink-ql/src/Connection/Connection.php(169): TBolier\RethinkQL\Connection\Connection->receiveResponse(820726866, Object(TBolier\RethinkQL\Message\Message))
#2 /code/vendor/tbolier/php-rethink-ql/src/Query/AbstractQuery.php(32): TBolier\RethinkQL\Connection\Connection->run(Object(TBolier\RethinkQL\Message\Message))
#3 /code/bin/OrderBook.php(28): TBolier\RethinkQL\Query\AbstractQuery->run()
#4 {main}

Next TBolier\RethinkQL\Connection\ConnectionException: Runtime error: U, jsonQuery: [1,[60,[[1,"test"]]],{"db":[14,["vagrant"]] in /code/vendor/tbolier/php-rethink-ql/src/Connection/Connection.php on line 181

This is because I did not grant the permissions to the user yet. Might need a different error message.

from php-rethink-ql.

tbolier avatar tbolier commented on May 28, 2024

...
This is because I did not grant the permissions to the user yet. Might need a different error message.

Thanks I have created a new issue for that one here: #78

from php-rethink-ql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.