websql drop column with javascript

2020-04-19 08:36发布

问题:

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