Skip to content

Conversation

anarcat
Copy link

@anarcat anarcat commented Mar 12, 2018

While sqlite obviously ships its own commandline interface to operate
on databases, it is not always as widely available as one would
expect. For example, I'm working on an embeded device here that runs a
custom Linux distribution, and sqlite is not shipped with the
distro. Deploying a binary of sqlite fails because it depends on
shared libraries, and going down that rabbit hole is a problem that
can be pretty hairy to solve. And compiling sqlite itself statically
isn't quite workable for all sorts of reasons.

Which brings us to this project: golang compiles statically by
default, and I've successfully deployed a small program using this
library on the embedded device without problems. But to do some more
debugging, I now need an actual SQL shell to run commands.

So I wrote this small command that creates a go-sqlite3 binary which
behaves somewhat like the normal sqlite command. It's way more limited
of course: output isn't really formatted correctly into tables and
only crude functionality is implemented. But databases can be read
with SELECT queries, which can be passed on the commandline or through
a crude shell-like commandline prompt.

This is similiar to the commands in _example but is actually usable,
so I have thrown it in the standard cmd subdirectory, in the hope it
can be installed directly.

Still missing:

@anarcat
Copy link
Author

anarcat commented Mar 12, 2018

and just now, obviously, I find out about usql which makes this kind of moot... but i guess it could still be useful if people don't want the 16MB binary.. :)

feel free to close this at any time...

@coveralls
Copy link

coveralls commented Mar 12, 2018

Coverage Status

Coverage decreased (-6.2%) to 62.27% when pulling 4593700 on anarcat:cmd into 9101028 on mattn:master.

@gjrtimmer
Copy link
Collaborator

Currently beyond the scope of this package.

@gjrtimmer gjrtimmer closed this May 30, 2018
@anarcat anarcat deleted the cmd branch May 30, 2018 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants