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
Document plain sqlite usage, for example for Svelte(Kit) #525
Comments
@bluepuma77 Can you share a template of your SvelteKit example i will implement the @capacitor-community/sqlite so it will be used for a full SvelteKit example. Please share it on github |
@jepiqueau Wow, now you really challenge me 😉 Does this work for you? Tested on
It currently uses sql.js for web and sqlite plugin for native, therefore Current issue is that the DB initialisation can not be awaited for in Capacitor, therefore the first render will show no data. |
@jepiqueau I've made a bit of a wrapper around the sqlite plugin that works with SvelteKit (and HMR quirks), perhaps it can help you: Aside from the above you need to copy |
@bluepuma77 @khromov look atvite-sveltekit-capacitor-sqlite to day the web part is implemented. Hope this will help you to start |
Thanks @jepiqueau ! Running a first test:
It works in Firefox on Mac, I can navigate to users, and save a name when it includes a space. Was wondering at first why the button is disabled 😉 Thanks for the template with the You can simply align the header with the window by placing this in
|
@bluepuma77 Thanks for your feedback. I didn't know SvelteKit so i had to figure out and test few things before to produce this example. I do not say that it is the best app implementation. The driver for it was to find the way to set-up the @capacitor-community/sqlite plugin, in order that developers could use it in that framework. As it works i will close the issue and make a link to reference that application in the @capacitor-community/sqlite list of application.thanks to push me to do it |
@bluepuma77 i develop a specific capacitor-typeorm-cli . If you could test it and revert to me |
Is your feature request related to a problem? Please describe.
I am trying to use SvelteKit with Capacitor (Starter, Recipe, CLI tool, Blog 1, Blog 2). Sadly most examples for sqlite here seem very specific to Angular, React and Vue.
When checking plain API docs, it sounds like everything just works out-of-the-box:
But the Web-Usage doc is many pages of code, and it's hard to see which is the generic and which is Angular/React/Vue specific.
Maybe I just don't understand what a "Stencil Component" actually is. Or why jeep-sqlite is needed. And what localforage is for.
Describe the solution you'd like
A clear and concise description of how to setup and use sqlite in native/web environment with plain Javascript. It would be great to have a simple stand-alone function to call after the page is loaded. Without polyfills, window use and document.body.appendChild() if possible.
Maybe that function can even become part of the package, why should everyone code this separately? And optional enable encryption.
Describe alternatives you've considered
Alternatively it would be awesome to have a full SvelteKit example, Svelte has already been mentioned in TypeORM-Usage doc.
The text was updated successfully, but these errors were encountered: