Hot answers tagged

51

Tried Sqliteman? Look for sqliteman in your package manager. It is stable, so should be broadly available.


36

I've been using sqlitebrowser, it is a really good options. Though probably not the only one! On Ubuntu, it is available in the default package repositores.


11

slm's solution is actually incorrect (while usable). When using Homebrew you should not add /usr/local/Cellar/* into your $PATH; instead what you should do is you should add /usr/local/bin into your $PATH (which you have already done) and then symlink things in the Cellar into /usr/local/bin. Since it's designed this way, Homebrew can obviously do this ...


9

That's all comes from quoting. Try this one: ssh aaron@10.1.150.53 'sqlite3 /home/aaron/dbname.db "UPDATE data SET \ LastStart = DATETIME('''NOW''') WHERE TaskName = '''taskname'''"' ps. You need to quote NOW, otherwise sqlite will try to find column with such name. But your quotes ' will be eaten by quotes from ssh. You can't escape ', therefore three ...


9

The sqlite3 interface uses the ReadLine library for command line editing. You can erase a full line with Ctrl+U but once you have pressed Enter, the line has been accepted and is no longer editable (well, it is, but not as part of the current statement). As you've noticed, sending end-of-file with Ctrl+D will prompt the client to exit, which is not what you ...


6

2-3 files per second tested with file seems very slow to me. file actually performs a number of different tests to try and determine the file type. Since you are looking for one particular type of file (sqlite), and you don't care about identifying all the others, you can experiment on a known sqlite file to determine which test actually identifies it. You ...


6

I've used the SQLiteStudio for working with sqlite3 database. It looks very well. The project is maintained (as of 2018). For some reason it is not available in common packages repositories.


5

Not sure why you want to use SQLite if you don't want the journal (have you considered the much faster WAL mode if speed is a concern?) but you can give multiple commands separated by semicolons: sqlite3 clipboard_archive.db "PRAGMA journal_mode = OFF; insert into cb (cb_context) values ('clipboard');"


5

SQLite meta commands are not terminated by ; but by newline. Therefore, you will have to provide the commands in some other way so that newlines are inserted in the correct places. Here's a few examples, of which I would probably use the first one (because it's readable). Use a here-document: sqlite3 testdb <<END_COMMANDS .mode csv .import /tmp/...


4

In such cases is advisable to store the data in an array. With version 4.0 or never the simplest is to use mapfile to populate it: #!/bin/bash mapfile username < <(sqlite3 db.sl3 "select user from main") yad --list --column="#" "${username[@]}" --height 200


4

Run it all as a single command: $ sqlite3 stylish.sqlite "SELECT * FROM styles;" > somefile.txt Example $ sqlite3 addons.sqlite "select * from icon;" > somefile.txt $ cat somefile.txt 1|32|https://addons.cdn.mozilla.net/img/uploads/addon_icons/354/354399-32.png?modified=1369154804 1|64|https://addons.cdn.mozilla.net/img/uploads/addon_icons/354/...


4

The sar command gives you all sorts of useful system activity. For example, for general CPU usage: sar -u 2 10 shows (note - this is not a debian system, but it should be similar): 09:31:55 AM CPU %user %nice %system %iowait %steal %idle 09:31:57 AM all 1.71 0.00 1.14 0.00 0.00 97.14 09:31:59 AM ...


4

It looks like it's hardcoded in line 5576 in shell.c (version 3.14.1): sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); So, to change it, your only option is to edit the source and recompile.


3

I've run into a similar problem, and the only solution I've found is to go into the pip build dir (/tmp/pip-{random hash}, can usually be found in the tail end of the error, may also be /usr/tmp/, or named pysqlite, depends on your setup) and alter the pysqlite setup.cfg. When downloaded it looks like this: [build_ext] #define= #include_dirs=/usr/local/...


3

A quick and dirty way to achieve what you want is to use rlwrap with the --remember (or -r) option: -r, --remember Put all words seen on in- and output on the completion list. After starting sqlite with: $ rlwrap -r sqlite database.sqlite make sqlite print all table and field names by issuing the meta-command .fullschema (or, with even less ...


3

If you look at: http://www.sqlite.org/fileformat.html, the SQLite format starts with the string "SQLite format 3\000". It seems to me that you could check head -c 16 of the file to check the format. I'd expect this to be faster then using more general purpose tools.


3

If you look at file's magic description for sqlite files, it looks for either SQLite format 3 or ** This file contains an SQLite at the beginning of the file. So you could either create a magic file with just those checks (and disable the builtin tests as in @ire_and_curses solution) or do the check manually: case $(head -c 31 < "$file") in ("** This ...


3

The following awk script does what you want, and even escapes quotes in strings: BEGIN { RS="\n\n" FS="\n" } function field(s) { sub(/^[^=]*= /, "", s) if (match(s, /^[-][0-9]+$/) == 0) { gsub(/'/, "''", s) s = "'" s "'" } return s } { print field($1) "," field($2) ...


3

I have not used this yet but looks promising especially if you're looking for a web-based interface. phpLiteAdmin


3

You can use for this purpose Valentina http://www.valentina-db.com/valentina-studio-overview, the program is free. It works on 3 OS: LIN, MAC, WIN. It works as with mySQL/mariaDB, so with PostgreSQL, SQLite and Valentina DB.


3

You can try Sqlite Manager Firefox Add-on.


3

Judging from your dpkg -l output, it looks like libsqlite3-0-3.7.17-1~bpo70+1 has been selected for removal (r), but is still installed (i) for some reason. You can check if any of your installed packages depend on this package by running: apt-cache --installed rdepends libsqlite3-0 If none of your installed packages depend on the problematic package, just ...


3

Two approaches: Sample test.csv file: GroupName,Groupcode,GroupOwner,GroupCategoryID System Administrators,sysadmin,13456,100 Independence High Teachers,HS Teachers,,101 John Glenn Middle Teachers,MS Teachers,13458,102 Liberty Elementary Teachers,Elem Teachers,13559,103 1st Grade Teachers,1stgrade,,104 2nd Grade Teachers,2nsgrade,13561,105 3rd Grade ...


3

I'll wager that the reason your scripts take so long is your running uuidgen (or cksum) for each line. Plenty of time is wasted simply starting the processes for each of them. Putting 5M lines of the form {"name": "John%d", "surname": "Gates", "country": "Germany", "age": "20", "height": "180"} in a file on a tmpfs filesystem, the following Python script ...


3

You've installed the program, not the dependency. The package_name RPM specifies a dependency on the sqlite RPM, not the sqlite program. Either install the sqlite RPM (after removing your manually-installed one) or tell RPM to ignore the dependencies while installing package_name: rpm -i --nodeps package_name.rpm.


2

If your user names don't contain any spaces or special characters (*?\[), you need just remove " and it will work ok: yad --list --column="#" $username --height 200


2

$PATH Yes you need to set your PATH variable like so: $ export PATH=/usr/local/Cellar/sqlite:/usr/local/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin That line can be a bit tricky to read so here it is split up by the colons, and each path is on its own line: $ awk -v addPath="$1" '...


2

I encountered a similar problem trying to install pysqlite in a virtualenv on Debian wheezy. I found this article: http://dimamoroz.com/blog/2-python-virtual-environment-ubuntu/ Which mentioned that I might need to install the dev version of libsqlite3 on Debian to allow pysqlite to be installed in the virtualenv: sudo apt-get install libsqlite3-dev I ...


2

The following works for me in mksh: $ echo $KSH_VERSION @(#)MIRBSD KSH R50 2014/10/07 $ x="Red,Yellow is a color,Blue" $ oIFS=$IFS $ IFS=, $ y=($x) $ IFS=$oIFS $ echo ${y[1]} Yellow is a color I believe it should work the same way in all versions of ksh.


2

Try to profile your application with iotop. sudo apt-get install iotop sudo iotop


Only top voted, non community-wiki answers of a minimum length are eligible