I want to store my installed packages to SQLite
This is mostly useless for most of people on the world, and this blog post is more a note to myself.
sqlite> CREATE TABLE packages (id INTEGER PRIMARY KEY, package TEXT); sqlite> INSERT INTO packages (package) VALUES ('test'); sqlite> INSERT INTO packages (package) VALUES ('test'); sqlite> SELECT * FROM packages ; 1|test 2|testWell, I solved the "SQLIte Auto increment" question!
pacman -Q \ | awk '{print "INSERT INTO packages (package) VALUES (\x27"$1"\x27);"; }' \ | sqlite3 packages.sqlite