sqlite3 查找 所有表名字

前端之家收集整理的这篇文章主要介绍了sqlite3 查找 所有表名字前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

http://stackoverflow.com/questions/82875/how-do-i-list-the-tables-in-a-sqlite-database-file

it appears you need to go through the *sqlite_master* table,like this:

<code style="border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:rgb(238,238,238); margin:0px; padding-left:0px; padding-right:0px; font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; font-size:14px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"><span class="kwd" style="font-size:14px;color:#008b;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">SELECT</span><span class="pln" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"> </span><span class="pun" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">*</span><span class="pln" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"> </span><span class="kwd" style="font-size:14px;color:#008b;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">FROM</span><span class="pln" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"> dbname</span><span class="pun" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">.</span><span class="pln" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">sqlite_master </span><span class="kwd" style="font-size:14px;color:#008b;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">WHERE</span><span class="pln" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"> type</span><span class="pun" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">=</span><span class="str" style="font-size:14px;color:#8000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">'table'</span><span class="pun" style="font-size:14px;color:#000000;border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:transparent; margin:0px; padding-left:0px; padding-right:0px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px">;</span></code>
<code style="border-bottom:0px; border-left:0px; padding-bottom:0px; background-color:rgb(238,serif; font-size:14px; vertical-align:baseline; border-top:0px; border-right:0px; padding-top:0px"><span style="font-size:14px;">如果在db中进行操作,可以把“dbname.”去掉,就ok了。</span></code>

And then manually go through each table with a SELECT or similar to look at the rows.

The .DUMP and .SCHEMA commands doesn't appear to see the database at all.

找了一下午,有留言说awesome。。。也代表我测试成功一刻的心情。。。感谢stackoverflow,感谢问这个问题和答这个问题的大牛小牛们

猜你在找的Sqlite相关文章