Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlBatch() definition: conflicting number of arguments #738

Open
valivvvv opened this issue Jan 10, 2018 · 3 comments
Open

sqlBatch() definition: conflicting number of arguments #738

valivvvv opened this issue Jan 10, 2018 · 3 comments

Comments

@valivvvv
Copy link

valivvvv commented Jan 10, 2018

I stumbled across a strange bug while executing a simple sqlBatch in an Ionic project:

db.sqlBatch( myBatchArray, () => { console.log('Executed BATCH INSERT SQL'); }, () => { console.log('FAILED BATCH INSERT SQL'); } );

This code was highlighted as wrong and would throw an error: "sqlBatch expects 1 argument, 3 given".

I figured out the problem was in node_modules/@ionic_native/sqlite/index.d.ts line 77:
sqlBatch(sqlStatements: Array<string | string[] | any>): Promise<any>;

While the definition in node_modules/cordova_sqlite_storage/WWW/SQLitePlugin.js line 265:
SQLitePlugin.prototype.sqlBatch = function(sqlStatements, success, error) { ...

To fix this I changed the line in index.d.ts to:
sqlBatch(sqlStatements: Array<string | string[] | any>, success: any, error: any);

Second thought, I'm not sure if this but should be posted on this repo, or should go to Ionic team. Let me know. Thanks!

@brodycj
Copy link
Contributor

brodycj commented Jan 10, 2018

Hi @valivvvv thanks for reporting, this should definitely be reported on Ionic instead. I think this should be reported on https://github.com/ionic-team/ionic-native.

That said @matrosov-nikita raised PR #657 to add typings to this project and it will very likely be integrated in the next release ref: #687.

@valivvvv
Copy link
Author

Hi @brodybits, cool, already submitted to ionic native as well: danielsogl/awesome-cordova-plugins#2258

Thanks for this awesome plugin!

@brodycj
Copy link
Contributor

brodycj commented Jan 10, 2018

Thanks again for reporting. If you have a chance to raise a PR to fix the issue I am sure it will be appreciated. I am sure they are over busy, just like everyone else:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants