如何打开核心数据库? [英] How to open a core data database?
本文介绍了如何打开核心数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有什么方法可以查看我的核心数据数据库,而无需通过代码加载它?
Is there any way in which I can view my core data database without having to load it programatically through the code?!
推荐答案
您应该能够使用sqlite3命令行工具直接查看数据库。数据库应存储在以下目录中:
You should be able to view the database directly using the sqlite3 command line tool. The database should be stored in the following directory:
~/Library/Application Support/iPhone Simulator/User/Applications/{your application GUID}/Documents/{your application name}.sqlite
要查看数据库, (注意,sqlite3应该已经在您的系统上默认安装):
To view the database, just type in the following in a terminal (note, sqlite3 should already be installed on your system by default):
sqlite3 {your application name}.sqlite
然后可以运行常规SQL来查看数据库中的数据。
You can then run regular SQL to view the data in the database.
请注意,以下有用的命令:
Note, the following useful commands:
- .help - 显示sqlite特定命令及其操作
- .tables - 显示数据库中的所有表 .schema {后跟表格名称} - 显示用于创建表格的create语句
- .quit - 退出sqlite3
-
- .help - Shows sqlite specific commands and what they do
- .tables - Shows all tables in the database
- .schema {followed by table name} - Shows the create statement used to create the table
- .quit - Exits sqlite3
这篇关于如何打开核心数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文