question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SqlStorage needs a way to do query without transaction

See original GitHub issue

Short description of the problem:

Currently when I run the statement pragma user_version; it errors out on IOS. Looking at the Cordova-sqlite-storage documentation PRAGMA statements need to be executed NOT in a transaction.

What behavior are you expecting?

Need to be able to run pragma statements without an error occurrng.

this.storage = new Storage(SqlStorage, { name: 'my.db' });
this.storage.query("pragma user_version;").then(
            (data) => {
                if (data.res.rows.length > 0) {
                   console.log(data.res.rows.item(0).user_version);
                }
            },
            (error) => {
                console.log(error);
            }
        );

currently returns SQLError:

code: 5
message: "could not prepare statement (23 not authorized)"

Which Ionic Version? 2.0.0-beta.10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
danbucholtzcommented, Jul 28, 2016

We are currently refactoring our storage APIs so we’ll ensure this use case is accounted for.

Thanks, Dan

0reactions
danbucholtzcommented, Oct 4, 2016

We refactored storage to use @ionic/storage.

This is no longer applicable. See this issue for suggestions on how to use sql in apps now.

Thanks, Dan

Read more comments on GitHub >

github_iconTop Results From Across the Web

SqlStorage needs a way to do query without transaction #7446
Looking at the Cordova-sqlite-storage documentation PRAGMA statements need to be executed NOT in a transaction. What behavior are you expecting?
Read more >
What happens if you don't commit a transaction to a database ...
The only way to complete a transaction is to commit, any other way will result in a rollback. Therefore, if you begin and...
Read more >
Azure SQL Database file space management - Microsoft Learn
This page describes how to manage file space with single and pooled databases in Azure SQL Database, and provides code samples for how...
Read more >
Yesquel: scalable SQL storage for Web applications
transactions. This is needed to implement SQL transactions. YDBT introduces a new caching scheme, new mecha- nisms and policies to split nodes, new...
Read more >
Troubleshooting for MDM SQL Storage - 7.3
When an unexpected issue occurs related to SQL query execution and there was ... of possible fields where you need to disable FK...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found