I'm using a sqlite database linked to my react-native app.
I've already done some queries in my app that work fine, so the query method is good.
Now, I've add new table to the database by adding a csv file in it (as I've already done before).
But when I make a call on the new table, the console tells me that there is 'no such table'.
If I put the sql query in my DB manager, the call do works.
Thanks for your help!
I did find the solution.
It is very simple, just create a new emulator and rerun your app. It seems that Android Studio works on a 'copy' of the project so it does not see the modification in the database.
Related
Some fields are not loading back in flutter app once I save them and load back.
While saving I am able to see the maps, it is correct only.
So, I want to check that load that sqlite db file.
For that, I kept a text field and ran the emulator.
But, when I ran the same on my mobile, it is not showing the db file path.
Can you explain how to get that file from the mobile(Oneplus 8t)?
in android studio you can see the database by going to : view=>tool windows => database inspector
I am trying to make a cross platform app using a local sqlite db and I got the plumming for IOS and Android set up.
I get to the point where I can get the db using "adb.exe and pull". I use DB browser for Sqlite to view the db file. The file has no tables.
But when I look into the SQLiteConnection in the code I can see the tables and if I query I get data.
Any ideas?
-- update
maybe I shoud mention. I am using Visual Studio with Xamarin forms and sqlite-net-pcl
I think the table exist in the db since you can query data from the table.
Could you try to use another tool to view the DB file instead of DB browser?
And make sure the db you open is the correct one.
Here is a link that might help you:
How to use ADB in Android Studio to view an SQLite DB
Started meteor+mongodb yesterday so probably it is a simple thing:
When we create a new project with meteor create appname and then run it with meteor run Meteor automatically creates a simple project for us, right? (that simple app with a button and a counter).
Ok, based in the fact that all meteor project has his own mongodb associated, how can I take a look on the default db created? I´d like to use a command on console to check the collection structure created by default..
I´ve tried: show dbs | show collections | Mongo.Collection();
But always get the same error message: use "new" to construct a Mongo.Collection.
Yeah, I know that. I know how to create a new mongodb and then create a collection and insert values on it.
But what about that counter that is already working? It´s storaging his values in a collection already created, right?
I´d like to access it... and maybe modify.. not create one db for my own at this moment... How can I do that?
Thanks
meteor mongo command gives you access to mongo console.
From official documentation:
meteor mongo
Open a MongoDB shell on your local development database, so that you
can view or manipulate it directly.
...you must already have your application running locally with meteor run.
http://docs.meteor.com/#/full/meteormongo
In my jQuery Mobile App i have created sQlite Database and all transactions work successfully , and I want to see the DB file, I searched for it in my project directory but I didn't found it? Does phonegap create file for the created sqlite DB? and where is it? how I can pull the DB file in order to see the inserted data?
I have searched over the internet but I didn't found any answer ,please help me .. since I am new in jQuery Mobile.
Thanks in advance.
Most likely your database is being created in android's cache directory. The following stackoverflow followup answer by the original questioner and it's backlink to an earlier answer should be all you need:
Using PhoneGap for Android : Not able to create table in the database
I'm in need of some help in developing a desktop application with a pre-populated database. I have tried numerous ways to get this working including those mentioned on both Tidesdk's API here http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Database.DB and at Titanium Desktops old API here http://developer.appcelerator.com/apidoc/desktop/latest/Titanium.Database-module.
While the later (using Titanium not Ti) works in creating a database in the apps directory it does not install my pre-populated sqlite database which is located in the resources file of my app.
A couple of my attempts located below
var db = Titanium.Database.openFile('test_db.sqlite', 'test_db');
var db = Titanium.Database.openFile(Ti.Filesystem.getFile(
Ti.Filesystem.getApplicationDataDirectory(), 'test_db.sqlite'));
var db = Ti.Database.open('test_db');
As stated most of these manage to create a database with the name given but when trying to run something as simple as a db.execute(SELECT) of something I know would exist in my pre-populated db I receive an error stating
Exception executing: SELECT name, id FROM people ORDER BY name COLLATE NOCASE, Error was: SQL Statement invalid or database missing
I have searched high and low for something to answer this but everyone continues to refer to the aforementioned API's or to the Mobile API's Ti.database.install() which does not work either.
Is it possible with titanium desktop to use a pre-populated sqlite database or do I have to populate it after I create it? If so any direction would be helpful (where to place the .sqlite file in the app and what functions to call).
I am currently using Titanium Studio with a titanium desktop osx SDK of 1.2.0.RC4 as requested by tidesdk.org until they have released there open source sdk.
Thanks in advance
This is possible, I just used this feature in a recent desktop app, deployed it successfully to Windows and Mac.
In my experience, sometimes your database file can be corrupted, for example if you use the Titanium.Database.install command, and it cant find the file to preload from (maybe the first time you specified the path wrong for instance), it will create the file itself, any subsequent install commands will not work because it already thinks this database has been installed.
Have you tried clearing out the application data? This is where titanium installs the database. For Mac this is in your /User/Library/Application Support/APPNAME directory. Their is a directory for databases, delete this and try again.
Also, this answer on Titanium Q&A may help, it talks about the process with the Mobile SDK but the Database stuff is the same.
Hope this helps!