sqlite3: tool for sqlite

编程入门 行业动态 更新时间:2024-10-09 22:21:08

sqlite3: <a href=https://www.elefans.com/category/jswz/34/1760480.html style=tool for sqlite"/>

sqlite3: tool for sqlite

  • install

get the source package or precompiled binary from .html

i just download a bin at my linux server, and ‘cp’ the sqlite3 into /usr/local/bin/

  • command
    open a db file and show the database info
$sqlite3 project.db 
SQLite version 3.8.11.1 2015-07-29 20:00:57
Enter ".help" for usage hints.
sqlite> .database
seq  name             file                                                      
---  ---------------  ----------------------------------------------------------
0    main             /home/admin/wei.xiew/mypyspider/data/project.db      

list tables and their schema

sqlite> .tables
projectdb
sqlite> .schema
CREATE TABLE `projectdb` (name PRIMARY KEY,`group`,status, script, comments,rate, burst, updatetime);

open another db file and show info

sqlite> .open ./task.db 
sqlite> .database
seq  name             file                                                      
---  ---------------  ----------------------------------------------------------
0    main             /home/admin/wei.xiew/mypyspider/data/./task.db            
sqlite> .schema
CREATE TABLE `taskdb_test_douban_movie` (taskid PRIMARY KEY,project,url, status,schedule, fetch, process, track,lastcrawltime, updatetime);
CREATE INDEX `status_taskdb_test_douban_movie_index` ON `taskdb_test_douban_movie` (status);
  • DML
sqlite> select count(*) from projectdb;
8
sqlite> select name from projectdb;
debug_dianping
test_UrlCrawl
test_dianping
test_dianping_zkgui
test_dianping_zkgui2
test_douban_movie
test_meituan
test_scrapy
sqlite> select name, status, comments, updatetime from projectdb;
test_scrapy|TODO||1440835716.78575
test_douban_movie|STOP||1441091444.00502
test_meituan|RUNNING||1442988518.57949
test_UrlCrawl|CHECKING||1441089121.88823
test_dianping|RUNNING||1442974044.22265
test_dianping_zkgui|TODO||1441875429.98845
test_dianping_zkgui2|STOP||1441711287.63994
debug_dianping|TODO||1442477219.00787
  • references
    usage of sqlite3: .html

更多推荐

sqlite3: tool for sqlite

本文发布于:2024-03-23 22:50:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1743773.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:tool   sqlite

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!