我正在制作一个phonegap应用程序并在那里使用ydn-db。
问题是我不想一直使用db = new ydn.db.Storage('db-name'),因为它会创建一个新的数据库。有没有办法检查我的数据库是否已经存在?
发布于 2013-11-22 14:36:04
你也可以使用来检查下面的代码。
// Populate the database
//
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS DEMO');
tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
}https://stackoverflow.com/questions/20138122
复制相似问题