Comments (16)
@jepiqueau this is a bit of a blocker for running transactions using the Capacitor driver on Android - the above solution has been tested and it indeed resolves the issue.
from sqlite.
@msfstef use the transitionBegin, transitionCommit see transition doc
from sqlite.
@msfstef i saw that you use API34 which is not compatible with Capacitor5
from sqlite.
Opened PR for this: #527
@jepiqueau we need to use the executeSet
run
and query
for everything for flexibility
from sqlite.
@msfstef i saw that you use API34 which is not compatible with Capacitor5
I don't think that's related to this issue - clearly this parsing being done here is failing for a valid statement type?
from sqlite.
@msfstef i saw that you use API34 which is not compatible with Capacitor5
This also occurs with API level 33
from sqlite.
@msfstef have you look at the doc provide iin v5.6.3 this is full tested. Are you working with @ygarg465 if yes please can only one register the issue it and follow it up it will be less confusion for me. Provide me a full code on github so i can add the case you are using
from sqlite.
@msfstef have you look at the doc provide iin v5.6.3 this is full tested. Are you working with @ygarg465 if yes please can only one register the issue it and follow it up it will be less confusion for me. Provide me a full code on github so i can add the case you are using
Both @ygarg465 and I are trying to unblock the usage of the driver with ElectricSQL - currently running the statement BEGIN
fails because of the lines mentioned by @ygarg465 above and it can be fixed with this PR.
I understand that you have a transaction API (I looked at the doc you mentioned) but for the sake of interoperability with multiple SQLite drivers we prefer to just be able to run SQLite statements and manage the rest on our side.
For reproducing the issue you can just run a BEGIN
statement and you should get the error.
from sqlite.
@msfstef OK i understand i will have a look
from sqlite.
@msfstef why do not use execute in tha case it will work. Run is more for insert, replace, update, delete which have all 6 characters for the command and is made when you have a statement with or without values to bind
from sqlite.
@jepiqueau you're right that for those particular statements with no bind values we can bypass the prepared statement route, good idea! Will have an immediate fix using that.
That being said, the parsing of the command with the arbitrary substring(0,6)
is still a bit problematic and the same statements should be able to run with the run
API as well, so fixing this issue I think is still important
from sqlite.
@jepiqueau you're right that for those particular statements with no bind values we can bypass the prepared statement route, good idea! Will have an immediate fix using that.
That being said, the parsing of the command with the arbitrary
substring(0,6)
is still a bit problematic and the same statements should be able to run with therun
API as well, so fixing this issue I think is still important
I agree as substring(0,6)
is not the best way to extract the statement type.
from sqlite.
@msfstef i will add to the documentation
- SQLite Data Definition Language commands (CREATE, ALTER, DROP) and the SQLite Transaction Control commands (BEGIN TRANSACTION, COMMIT, ROLLBACK) must used
execute
method. - SQLite Data Manipulation Language commands (INSERT, UPDATE, DELETE, REPLACE) must used
run
method if they have bind values and can useexecute
orrun
methods if they do not have bind values. - SQLite Data Query Language commands (SELECT) must used
query
method.
Will this clarify how to use the capacitor-community/sqlite plugin
from sqlite.
@msfstef Can i close the issue, i will reject the PR if you now agree
from sqlite.
@jepiqueau sure - I still think the current parsing method of the command is a bit arbitrary and error-prone, but I understand that you want to support run
only for the 4 DML commands.
Either way my issue is unblocked through using execute
so feel free to close.
from sqlite.
@msfstef @ygarg465 thanks for your understanding this is the way i develop the software i must have put this at the early stage of développement. This will have avoid mis-understanding and waste of time for developers
from sqlite.
Related Issues (20)
- WAL mode with typeorm stopped working from version 0.3.18 HOT 9
- Is this plugin still maintained in 2024? HOT 2
- "CapacitorSQLite" plugin is not implemented on ios HOT 4
- ionic7-angular-sqlite-app tutorial ionic.config.json type angular-standalone doesn't exist HOT 1
- ionic7-angular-sqlite-app tutorial fails on v5.7.1 HOT 6
- GetFromHTTPRequest not working HOT 3
- Multi Row Statement does not escape characters HOT 4
- Multiple Row Statement Values case insensitive HOT 3
- Multirow statements inserts wrong semicolon HOT 2
- foreign key ON DELETE CASCADE HOT 1
- Create CapacitorJS v6 package compatibility HOT 41
- ExecuteTransaction with values throws exception for statements performing no actual changes HOT 5
- Memory leak using .saveToStore() HOT 18
- Migration not working on iOS HOT 3
- executeSet not inserting rows HOT 8
- Multi Value Statement error with spaces inbetween ? HOT 1
- Multi row statement should fail if no values are replaced HOT 5
- Can I use this plugin inside the background runner capacitor plugin? HOT 2
- Update Capacitor dependencies to version >6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite.