websql drop column with javascript

不羁岁月 提交于 2019-12-02 13:30:22

问题


I'm trying to delete a column in a websql database with javascript. I have tried the following with no success:

db.transaction(
    function(transaction) {           
        transaction.executeSql('ALTER TABLE log_entries DROP COLUMN name;');
    }
);

where, name is the column I want to delete from the table log_entries.

Could someone please advise me how I would go about deleting a column in a websql database with javascript?


回答1:


In the Web SQL is not implemented removing fields. I'm currently working on this problem. One of way - data dump and remove the table. Then restore the table with the new fields. Restore the data from the dump



来源:https://stackoverflow.com/questions/15108204/websql-drop-column-with-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!