Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't open Sqlite on Git Bash

I'm trying to access my sqlite database on my current directory at /c/wamp/www/laravel5 on my local project folder, with windows as my OS. I added the sqlite3 executable on the directory.

The database doesn't seem to open using git bash. When using the default command in windows command prompt it works seamlesly. sqlite3.exe storage/database.sqlite

Tried on Git Bash:

$ ./sqlite3.exe 

and

$ ./sqlite3.exe storage/database.sqlite

These didn't work. The error message is:

bash: sqlite3.exe: command not found

Here's a snapshot: enter image description here

I'd like to see the database tables and schema using git bash since it has cooler font colors compare with the windows cmd.

Any help would be greatly appreciated.

like image 446
Jed Avatar asked Oct 22 '15 02:10

Jed


People also ask

How do I open SQLite in terminal?

If you are using Linux or a Mac, open a terminal window instead a command prompt. Open a command prompt (cmd.exe) and 'cd' to the folder location of the SQL_SAFI. sqlite database file. run the command 'sqlite3' This should open the SQLite shell and present a screen similar to that below.

Does GIT use SQLite?

SQLite does not use the Git version control system. SQLite uses Fossil instead, which is a version control system that was specifically designed and written to support SQLite. People often wonder why SQLite does not use the Git version control system like everybody else.


2 Answers

if you have the same problem I had, then see my question here.

In short, using "winpty" to start sqlite3 worked:

$ winpty sqlite3
like image 86
user172431 Avatar answered Dec 09 '22 21:12

user172431


Building on the previous answer by @user172431, add the following alias to your .bashrc

alias sqlite3="winpty sqlite3.exe"

This will make the workflow a tad quicker and feel like a ninja rock-star in the process. I use this shortcut via Git Bash

like image 33
ammonvictor Avatar answered Dec 09 '22 23:12

ammonvictor