Comments (10)
I haven't tested it myself, but it looks like the lua's return
statement is missing in your first example. Try this line instead:
$result = $client->evaluate('return box.sql.execute([[SELECT * FROM table1;]])'); // <- note return here
from client.
And it works with next way...
$client->evaluate('function testfunc()
return box.sql.execute([[SELECT * FROM table1;]])
end');
$result = $client->call('testfunc');
var_dump($result->getData());
Result is:
array (size=1)
0 =>
array (size=1)
0 =>
array (size=2)
0 => int 1
1 => string 'A' (length=1)
from client.
Thanks! It works!
from client.
Thank you very much for the library!
I would not like to correct such mistakes -
`PHP Fatal error: Uncaught Error: Class 'MessagePack\Packer' not found in /home/work/php/test/vendor/tarantool/client/src/Packer/PurePacker.php:19
Stack trace:
#0 /home/work/php/test/tarantool.php(12): Tarantool\Client\Packer\PurePacker->__construct()
#1 {main}
thrown in /home/work/php/test/vendor/tarantool/client/src/Packer/PurePacker.php on line 19
Fatal error: Uncaught Error: Class 'MessagePack\Packer' not found in /home/work/php/test/vendor/tarantool/client/src/Packer/PurePacker.php:19
Stack trace:
#0 /home/work/php/test/tarantool.php(12): Tarantool\Client\Packer\PurePacker->__construct()
#1 {main}
thrown in /home/work/php/test/vendor/tarantool/client/src/Packer/PurePacker.php on line 19`
from client.
Hi Artem,
Looks like the rybakit/msgpack package is missing in your setup, check a note under the "Usage" section for details: https://github.com/tarantool-php/client#usage.
TLDR, try to run composer require rybakit/msgpack
to solve the issue.
from client.
Yes, thank you very much, I did it.
I would like this dependency to be enabled by default!
from client.
I would like this dependency to be enabled by default!
Well, rybakit/msgpack is not necessary if you use the msgpack-php pecl extension. That is why it's not enabled by default.
from client.
how to get an associative array?
from client.
var_dump($result->getData()); returns values without columns
from client.
@artem-webdev Please ask that kind of questions on stackoverflow.com or at least create a dedicated issue, it will make easier to other concerned developers to find answers to these questions in the future.
from client.
Related Issues (20)
- Use Php-client with queue? HOT 3
- possibility to bind params through LUA procedures? HOT 3
- get Space names HOT 4
- executeQuery generates an unknown Request type 11 fatal error HOT 2
- get primary key field names HOT 2
- fetch and return an associative array of datas HOT 2
- Tarantool-php client performances vs pdo/mysql HOT 6
- Unexpected response received: expected sync #974229717, got #429377306. HOT 2
- Multiple insertion of rows in a single transaction HOT 1
- How to connect on remote server HOT 1
- typofix in README.md HOT 1
- "Space 'X' does not exist" exception occurs under load HOT 1
- Return an associative array of data HOT 1
- Bug with select from space with uuid type field by SQL protocol HOT 4
- Require rybakit/msgpack dependency
- Some tests started to fail since Tarantool 2.11.0-entrypoint tag HOT 3
- Non informative trace log of Exceptions HOT 2
- memory leaks with SQL - prepared statements HOT 2
- CI fails due to missing library `libmpdec-dev` for Debian Bookworm
- Why not Symfony/uid ^7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client.