-
Notifications
You must be signed in to change notification settings - Fork 107
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
bug: cannot create tables with standard sql statements #254
Comments
This is how I have created a table and all are working fine for me: i.e.
This is my |
@tobiasmuecksch Are you using the Web part of the plugin? |
@jepiqueau Yes. With |
@tobiasmuecksch Can you share your project on github. As your
it should return
|
@jepiqueau I'll create a demo specifically for this problem in the next hours. |
@tobiasmuecksch it should come from your setup. i test it this morning with Safari Version 15.3 (17612.4.9.1.8) and as foreseen i do not have any issue. Which framework are you using? |
@tobiasmuecksch i just saw that you are using Safari 15.4, i did not have it install yet |
I'm working with Ionic & Angular. This is the repo I'm working in (https://github.com/tobiasmuecksch/capacitor-sqlite-angular). You should know it, since you already helped me with getting sqlite to work in the browser. It does not contain the code for the reproduction yet. I'll let you know, when I have finished. |
I've just tested it in Chrome 100 and the error is there too. |
@tobiasmuecksch that is what i was just thinking suggesting. So it is not due to Safari 15.4 |
@jepiqueau While creating the demo code, I found the problem: I haven't closed the connection after creating the table. Instead I've reused the same connection to run a select query. Do I have to close the connection after every query? Are there any rules on when I have to close db connections? |
@tobiasmuecksch No you should not but for web you have a
When you use the my test code is:
with
Hope this clarify |
@tobiasmuecksch in my code above you can replace
by
and continue working with the open connection |
@jepiqueau Do I have to call the |
@tobiasmuecksch It is not mandatory, you can do it at your discretion when the database got quite a number of changes and that if there is a crash of the browser or the app these changes would have already been stored in localforage store |
Allright. Thank you so much, for your awesome support! Just one more question. If I would never call this method, does the plugin automatically save the data to the store from time to time? |
@tobiasmuecksch No, it is only call automatically when you close the db or the connection |
Good to know! Thank you very much. |
Describe the bug
I'm trying to create tables with standard sql statements as described in the documentation.
But sqlite responds with
{changes: {changes: 0}}
and the table is not created. There is no exception thrown.When I try to read or write to the table, an exception is thrown stating, that the table does not exist.
To Reproduce
Expected behavior
The table should be created.
Additional context
Tested in browser (Safari 15.4)
The text was updated successfully, but these errors were encountered: