3

I found that I can do SQL requests but only inside Tarantool.

Can I somehow connect to Tarantool like in MySQL shell or Postgres shell?

mysql -u admin -h localhost -P 3301
# or
psql ...

Or how to configure other programs that understand only MySQL or Postgres connections to use Tarantool?

Sergey
  • 19,487
  • 13
  • 44
  • 68

1 Answers1

4

You cannot use either mysql or psql console commands to connect to Tarantool, because the communication protocol is different for each server. For the same reason, for example, you cannot connect to Posgres using the mysql utility. However, nothing prevents you from using tarantoolctl to perform SQL requests to Tarantool. Once attached to an instance (either with tarantoolctl enter my_instance or tarantoolctl connect <uri>), you can switch the default language from Lua to SQL:

\set language sql
\set delimiter ;

After that you will be able to execute SQL statements directly in the console.

For the record, it's also possible to execute SQL using Lua functions, but this may seem less convenient:

box.execute([[ SELECT 1, 2, 3 ]])
Eugene Leonovich
  • 884
  • 1
  • 9
  • 15