Skip to content

Can't open database #28

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

Open
JoaoCnh opened this issue Sep 30, 2015 · 7 comments
Open

Can't open database #28

JoaoCnh opened this issue Sep 30, 2015 · 7 comments

Comments

@JoaoCnh
Copy link

JoaoCnh commented Sep 30, 2015

So I created an .sql and .sqlite file through the Terminal.

I created the same table and inserted one row. To see if I could read from it.

I placed the files in the same place as in the react-native-sqlite-example and both of them don't work.

The error message while selecting all rows (select * from table;) basically returns the error message:

No such table: teste (teste is my table btw)

So I see someone here got a similar error. No file is created either. I would love to have this working.

@jaygarcia
Copy link

Did you add the file to the project and make sure that it's being copied to your app in development?

@JoaoCnh
Copy link
Author

JoaoCnh commented Sep 30, 2015

I added the file to the project and I didnt quite understand what you meant by "make sure that it's being copied to your app in development".

All I did is put the file in the folder like the example. Since no more instructions were given I thought that was it. Is there something more I should do?

@rhaker
Copy link

rhaker commented Oct 2, 2015

You shouldn't need to create the files via the terminal. The .sqllite file gets auto-created in the app documents directory if it doesn't exist already. And you can run the sql commands via javascript (to create a table, insert data, etc). It should work. It does for me.

@JoaoCnh
Copy link
Author

JoaoCnh commented Oct 2, 2015

No files are created for me. What is the relative path to the documents folder?

@ermannos
Copy link

ermannos commented Feb 8, 2016

You should create a folder in your XCode named Documents and put the sqlite file there.
Also verify that the sqlite file is included in the list named Copy Bundle Resources in Build Phases of your project.
This worked well form me

@diemvtt
Copy link

diemvtt commented Sep 28, 2016

@ermannos Can you explain how to do clearly? I have a problem with database like this. But i've tried to do like you said. But it's not work. Thank you.

@almost
Copy link
Owner

almost commented Sep 28, 2016

Please don't use this library! It's been surpassed by other more recent libraries such as https://github.com/andpor/react-native-sqlite-storage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants