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

Unable to access sqlite from react native windows #10431

Closed
biswajeet2k17 opened this issue Aug 23, 2022 · 4 comments
Closed

Unable to access sqlite from react native windows #10431

biswajeet2k17 opened this issue Aug 23, 2022 · 4 comments
Labels
Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo

Comments

@biswajeet2k17
Copy link

biswajeet2k17 commented Aug 23, 2022

I am using the 'react-native-sqlite-storage' module to fetch data from an existing sqlite db into a react-native windows application. I have followed the steps as mentioned for windows platform here. But, I am not able to open database using the openDatabase() API. Although, it mentions that the module works for Windows, but looking at the parameters of the API and code, I see references to only iOS/Android. Does this library does not work for Windows application to access sqlite db? If not, which is the best library to use to access sqlite from react native in windows.

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Aug 23, 2022
@chrisglein
Copy link
Member

This library is supposed to work on Windows, and to my knowledge it's the only sqlite library that supports Windows (See this thread: #10409). There is certainly more regular traffic on the async-storage library, if you don't specifically need sqlite. But if sqlite-storage isn't working for you then you should open an issue against the react-native-sqllite-storage repo.

@chrisglein chrisglein closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2022
@ghost ghost removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Aug 25, 2022
@chrisglein chrisglein added Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo labels Aug 25, 2022
@MacKenzieHnC
Copy link

MacKenzieHnC commented Dec 23, 2022

As an end user struggling with this very thing, I think the problem here is rooted in people not understanding how to include the db file properly, which is not an issue with the sqlite module. Having no UWP or VS background, I have found the following questions nearly impossible to figure out:

  • How do you build your file structure for a react-native-windows project so that your assets are included in the build? (Related to this)
  • Is there any other code required to make the bundling work properly (e.g. <AppxPackagePayload Include="whatever">, etc.)?
  • Is VS required for including files or can it be done manually (there are several references in various StackOverflow posts to using VS to "include in project", but react-native-windows doesn't claim to require VS to function)
  • Once you've included the file successfully, what directory do your URIs start from? (i.e. How do I navigate the AppX folder from URIs that live inside of my .js files?)

I've tried everything I could google my way to, but so far have been fully unsuccessful. Some additional documentation for these questions would be greatly appreciated

@ghost ghost added the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Dec 23, 2022
@chrisglein
Copy link
Member

It sounds like what you're looking for and not finding is the information for how to include non-image files in a way that'll get bundled and included with your project. Does that sound correct?

@MacKenzieHnC
Copy link

MacKenzieHnC commented Jan 6, 2023

It sounds like what you're looking for and not finding is the information for how to include non-image files in a way that'll get bundled and included with your project. Does that sound correct?

Correct. I have now solved it, but finding it was a bit of a nightmare. Some easier-to-find documentation would be wonderful for the next poor soul. Let me know if you would like me to create a new issue or discussion for this.

I can't find all the links I used to cite my sources, but...

  1. While I get the assertion that people should be using require, it is not easy to figure out how to do that for arbitrary filetypes when you're new enough that you're not even sure what to google, so that could use documentation if it's the direction you want to push people in (I know that's a React issue, but they're unlikely to solve it, so even linking to one of the StackOverflow posts would be helpful for module creators)
  2. Even with that, many of us are subservient to modules that have not used that paradigm, so documentation for how using ms-appx works and using VS to include files is still needed. I was only able to figure it out by finding this and then studying the git changes that created.
  3. Documentation for manually including files by modifying the .vsxproj files would also be helpful if you're not going to list Visual Studio as a requirement for using your module. I understand doing so manually is recommended against, but it seems to me to be the only way to accomplish this without using VS.

@chrisglein chrisglein removed the Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot) label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extensions Tracks issues against community modules and extensions External Issue tracked in this repo but change will need to happen in another repo
Projects
None yet
Development

No branches or pull requests

3 participants