gpt4 book ai didi

ios - 在 iOS App 中将 SQLite 数据库从 Titanium 迁移到 Ionic

转载 作者:可可西里 更新时间:2023-11-01 05:42:55 26 4
gpt4 key购买 nike

我正在用一个旧的 Titanium/Alloy 应用程序的 Ionic 版本更新应用程序商店。 Alloy sql.js 同步适配器具有:

var ALLOY_DB_DEFAULT = "_alloy_";

运行用 iExplorer 制作的旧应用程序的手机备份包含以下文件:

(App)/Library/Private Documents/_alloy_.sql

我可以在 Ionic 中像这样访问这个数据库吗?

    db = window.sqlitePlugin.openDatabase({
name: '_alloy_.sql',
location: 1,
})

我正在尝试运行旧应用程序并测试迁移,但此时 Titanium Studio 很难启动。如果我只是将旧的 _alloy_.sql 文件填充到 iOS 模拟器中,我的迁移就可以正常进行:

~/Library/Developer/CoreSimulator/Devices/<id>/data/Containers/Data/Application/<id>/Library/

最佳答案

旧线程响应,希望有人仍然觉得答案有用。

我们已经解决了我们自己的赏金问题。

数据库存储在IOS库中的'Private Data'目录中,文件名为_alloy_.sql

let tiAppOptions = {name: "Private Documents/_alloy_.sql", iosDatabaseLocation: 'Library'};

this.sqlite.create(tiAppOptions).then((db: SQLiteObject) => {
db.executeSql("SELECT * from table_name", {}).then((data) => {
//do something with the data.
});
}, err => {
console.log(err);
});

Android 存储在“默认”位置,文件名为 _alloy_.sql

关于ios - 在 iOS App 中将 SQLite 数据库从 Titanium 迁移到 Ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46629054/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com