2017 © Pedro Peláez
 

library phpsql

Console PHP SQL client

image

josecelano/phpsql

Console PHP SQL client

  • Friday, December 22, 2017
  • by josecelano
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

PHP multi database console client

I needed a SQL Server console client on a Linux system and I found this one:, (*1)

https://github.com/hasankhan/sql-cli, (*2)

and I decided to do the same for PHP., (*3)

Install

git clone git@github.com:josecelano/phpsql.git
cd phpsql

You can use it in 3 different ways:, (*4)

SQL as argument

bin/phpsql --user=root --password= --database=homestead --host=127.0.0.1 --port=3306 "show tables"

Standard input (pipe)

echo "show tables" | bin/phpsql  --user=root --password= --database=homestead --host=127.0.0.1 --port=3306

Interactive shell

bin/phpsql --interactive --user=root --password= --database=homestead --host=127.0.0.1 --port=3306

Test

composer test

TODO

  • I had to add the --interactive option. Ideally interactive mode should be automatically executed if there are no data from the standard input.

Output

Output should be something like:, (*5)

C:\Projects\phpsql (master)
λ bin\phpsql.bat --interactive --user=root --password= --database=homestead --host=127.0.0.1 --port=3306
Welcome to interactive php SQL shell. Type 'quit' or 'exit' to exit.
>show tables
+-------------------------+
| Tables_in_homestead     |
+-------------------------+
| appliances              |
| history                 |
| history_types           |
| migrations              |
| password_resets         |
| permission_role         |
| permissions             |
| role_user               |
| roles                   |
| sessions                |
| social_logins           |
| users                   |
| wishlist_item_feedbacks |
| wishlists               |
+-------------------------+
>

The Versions

22/12 2017

dev-master

9999999-dev

Console PHP SQL client

  Sources   Download

The Requires

 

The Development Requires