博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Sqlite文件在ubunut的查看
阅读量:4959 次
发布时间:2019-06-12

本文共 1667 字,大约阅读时间需要 5 分钟。

 

 

 

 

1.

 

The .tables, and .schema "helper" functions don't look into ATTACHed databases: they just query the SQLITE_MASTER table for the "main" database. Consequently, if you used

ATTACH some_file.db AS my_db;

then you need to do

SELECT name FROM my_db.sqlite_master WHERE type='table';

Note that temporary tables don't show up with .tables either: you have to list sqlite_temp_masterfor that:

SELECT name FROM sqlite_temp_master WHERE type='table';
  
  • 81
    Only "SELECT name FROM sqlite_master WHERE type='table'" works for me –  
  • 2
    SELECT name FROM my_db.sqlite_master WHERE type='table'; this does not work for me (for the attached DB) and it throws error as: no such table exist "my_db.sqlite_master" –  
  •  
    what you meant by temporary tables? Are there any when I just opened SQLite db file? –  
  •  
    Temporary tables are those created with CREATE TEMPORARY TABLE SQL commands. Their contents are dropped when the current database connection is closed, and they are never saved to a database file. –  
  • 1
    Under sqlite3 command mode and run ATTACH "some_file.db" AS my_db; It worked! –  

 

 

 

 

2.You could attach another database file from the SQLite shell:

sqlite> attach database 'RelDb.sqlite' as RelDb; sqlite> .databases main: /db/UserDb.sqlite RelDb: /db/RelDb_1.sqlite sqlite> .tables RelDb.collectionRelationship contentStatus RelDb.contentRelationship genres RelDb.leagueRelationship recordingFilter RelDb.localizedString syncedContentStatus accountLevelSettings syncedThumbs collectionActivity thumbs

The tables from this 2nd database will be accessible via prefix of the database:

sqlite> select count(*) from RelDb.localizedString; 2442

转载于:https://www.cnblogs.com/x-poior/p/9936459.html

你可能感兴趣的文章
ASP.NET中 GridView(网格视图)的使用前台绑定
查看>>
深入了解Oracle ASM(二):ASM File number 1 文件目录
查看>>
Boosting(提升方法)之AdaBoost
查看>>
链接元素<a>
查看>>
Binding object to winForm controller through VS2010 Designer(通过VS2010设计器将对象绑定到winForm控件上)...
查看>>
Spring Boot实战笔记(二)-- Spring常用配置(Scope、Spring EL和资源调用)
查看>>
活现被翻转生命
查看>>
POJ 1228
查看>>
SwaggerUI+SpringMVC——构建RestFul API的可视化界面
查看>>
springmvc怎么在启动时自己执行一个线程
查看>>
流操作的规律
查看>>
Python基础学习15--异常的分类与处理
查看>>
javascript运算符的优先级
查看>>
React + Redux 入门(一):抛开 React 学 Redux
查看>>
13位时间戳和时间格式化转换,工具类
查看>>
vue router-link子级返回父级页面
查看>>
C# 通知机制 IObserver<T> 和 IObservable<T>
查看>>
Code of Conduct by jsFoundation
查看>>
div 只显示两行超出部分隐藏
查看>>
C#小练习ⅲ
查看>>