Skip to content

joanbono/mygosql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

make deps
make install

USAGE

Create a config.toml file as follows:

# filename: config.toml
[database]
user = "root"
password = "toor"
server = "localhost"
port = "3306"
database = "MyDatabase"

Then you can use it:

mygosql USAGE:
  -config string
    	config.toml file (default "./config.toml")
  -query string
    	Query to perform

There are not much functions supported yet:

➜  mygosql -query "SHOW Databases;"
+--------------------+
| SHOW DATABASES;    |
+--------------------+
| MyDatabase         |
| information_schema |
+--------------------+

➜  mygosql -query "SHOW TABLES;"   
+--------------+
| SHOW TABLES; |
+--------------+
| test         |
| user         |
| pass         |
+--------------+

➜  mygosql -query "SELECT * FROM user;"
+---------------------+
| SELECT * FROM user; |
+---------------------+
| root                |
| admin               |
| john                |
| alice               |
+---------------------+

Building

make all