Alasql: Indexeddb Delete from is not working

Created on 6 Aug 2020  路  12Comments  路  Source: agershun/alasql

Hi Team,

        Indexed dB Delete from not working
! Bug Code provided to reproduced Good first issue Help wanted

All 12 comments

@SathishRamV Thank you for letting us know. Any chance you have an example that is not working?

TypeError: alasql.engines[db.engineid].loadTableData is not a function
at statement (alasql.js:15032)
at Function.alasql.dexec (alasql.js:4654)
at Function.alasql.exec (alasql.js:4607)
at alasql (alasql.js:138)
at alasql.js:5232
at new Promise ()
at promiseExec (alasql.js:5231)
at Function.alasql.promise (alasql.js:5280)
at WebdevComponent_SAT.js:388

function clearIDBData1(IDDBName) {
var Database = IDDBName;
console.log(Database);
var Query = 'DELETE FROM ' + Database;

alasql.promise('CREATE INDEXEDDB DATABASE IF NOT EXISTS ' + Database + ' ;')
    .then(function () { return alasql.promise('ATTACH INDEXEDDB DATABASE ' + Database + ' ;'); })
    .then(function () { return alasql.promise('USE ' + Database + ' ;'); })
    .then(function () { return alasql.promise(Query, []); })
    .then(function (res) {
        var a = res;
        //var SqlStr1 = 'SELECT ' + HTAlsqlCol + ' FROM ?'
        //var DataForGraph = alasql(SqlStr1, [a]);
        //hot3.loadData((DataForGraph));
    })
    .catch(function (r) {
        console.log(r);
    })

}

@mathiasrw

function clearIDBData1(IDDBName) {
var Database = IDDBName;
console.log(Database);
var Query = 'DELETE FROM ' + Database;

alasql.promise('CREATE INDEXEDDB DATABASE IF NOT EXISTS ' + Database + ' ;')
    .then(function () { return alasql.promise('ATTACH INDEXEDDB DATABASE ' + Database + ' ;'); })
    .then(function () { return alasql.promise('USE ' + Database + ' ;'); })
    .then(function () { return alasql.promise(Query, []); })
    .then(function (res) {
        var a = res;
        //var SqlStr1 = 'SELECT ' + HTAlsqlCol + ' FROM ?'
        //var DataForGraph = alasql(SqlStr1, [a]);
        //hot3.loadData((DataForGraph));
    })
    .catch(function (r) {
        console.log(r);
    })
} 

Looks like we enforce where 1 from https://www.w3schools.com/sql/sql_delete.asp

i have to use Where Condition for Delete FROM? @mathiasrw

I have a feeling that will work - yes. I have not verified... But its still a bug that you found it...

Any update on this @mathiasrw

Hello Guys Any update ? @mathiasrw

@SathishRamV We have not yet received any PR fixing this.

Hi Guys, I would like to help in this regards. I am still new to contributing to open source projects, but I want to help. Is there any way I can contribute to this repo ?

Lovely. Have a look at https://github.com/agershun/alasql/blob/develop/.github/CONTRIBUTING.md and let me know if you have any questions :)

Thanks, Will Do.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

morrme picture morrme  路  5Comments

umasudhan picture umasudhan  路  4Comments

SamanthaAdrichem picture SamanthaAdrichem  路  4Comments

karubimania picture karubimania  路  6Comments

SWard1992 picture SWard1992  路  3Comments