简体   繁体   English

Tizen Wearable Native Application:我们如何转储 SQLite 数据库?

[英]Tizen Wearable Native Application: How do we dump a SQLite database?

I'm implementing a Tizen Wearable Hybrid Application (Web UI + Native Service).我正在实施一个Tizen 可穿戴混合应用程序(Web UI + 本机服务)。 Native Service uses the SQLite Database for record maintenance. Native Service 使用SQLite 数据库进行记录维护。 I need to export a SQLite dump file of the database in csv format to share that with the Web UI.我需要以csv格式导出数据库的SQLite 转储文件,以便与 Web UI 共享。 Unfortunately I couldn't find anything with the web search.不幸的是,我无法通过网络搜索找到任何内容。 Someone please guide me how can I create a dump file from SQLite in Tizen Wearable Native Application?有人请指导我如何在 Tizen Wearable Native Application 中从 SQLite 创建转储文件?

I think that what you need is to implement datacontrol provider functionality in your native service application and datacontrol consumer functionality in your UI Web application.我认为您需要的是在您的本机服务应用程序中实现数据控制提供者功能,并在您的 UI Web 应用程序中实现数据控制消费者功能。

Provider can implement SQL data provisioning and update, consumer can then use data provided using Web API .提供者可以实现 SQL 数据供应和更新,消费者然后可以使用通过Web API提供的数据。

Method 1. Converting db files to csv file方法一、将db文件转为csv文件

1) Copy db files to res
https://developer.tizen.org/ko/forums/native-application-development/how-copy-sqlite-data.db-file-application-runtime?langredirect=1#comment-25969

2) Converting db files to csv file
https://www.tutlane.com/tutorial/sqlite/sqlite-export-data-from-table-to-csv-file

Method 2. Coding read data and write them to csv file directly Exporting the sqlite3 table into file using "C" execute API方法2. 编码读取数据并直接写入csv 文件使用“C”执行API将sqlite3表导出到文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM