storesafe / cordova-sqlite-storage-help

Help forum for Cordova sqlite plugin projects
2 stars 1 forks source link

When can I "ALTER TABLE" and "CREATE TABLE"? #29

Open luigi37 opened 7 years ago

luigi37 commented 7 years ago

After some attempts, I realised that "ALTER TABLE" (to add columns) and "CREATE TABLE", for already existing DBs is possible with a transaction nested with Database opening or anyway before any other type of transaction. Is my impression correct? Is that by design for a specific reason or it's constrained by some tech reasons? Is STD Websql (whatever std websql means) behaving the same (it seems there isn't this constraint in Chrome implementation). Thanks

brodycj commented 6 years ago

Unfortunately I cannot really understand. It should be no problem to use operations such as "ALTER TABLE" or "CREATE TABLE" within a standard transaction, db.executeSql call, or db.sqlBatch. In case of issues with this kind of statement please post a complete test program to demonstrate.