简体   繁体   中英

websql drop column with javascript

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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