How can I view the Tables structure in sqlite Manager add-on on Firefox? - ios

I am creating a Database called Reminder.sqlite via Sqlite Manager add-on in firefox, after creating I am importing it to my iOS Application, the problem is that records are saved in database table but when I run a Select query in Sqlite manager no records are displayed any suggestions why this is happening?

make sure you have add database file into project and remove database file from document directory.
because old file is exist in document director, your new file with same name cannot be overwrite old one.(according to approach, if we use in code)
It may help you.

Related

Load an SQLite Database preloaded into Core Data

I have a database preloaded in SQLite: "BenedictusCoreData.sqlite".
I add it to the project in XCode.
I modify the BenedictusCoreData.xcdatamodeld to create the entities and attributes with the same name and type as the tables and columns of my sqlite preoloaded.
I run the app in the simulator without writing any additional code. I print the main bundle path and go to the sandbox of the application. And inside /Library/Application Support/ I find the three files: .sqlite .sqlite-shm .sqlite-wal
I open the .sqlite and obviously it is empty, however Xcode has created the tables and the columns with capital letters, adding "Z" to the tablenames and "Z" to the column names, appart from adding new tables "Z_METADATA" "Z_MODELCACHE", "Z_PRIMARYKEY".
At this point, I assume that it is not a good idea just to copy my sqlite from the bundle into the "Application Support" folder and rewrite the file, because the structure is totally different.
So I am lost about how to proceed in order to copy a sqlite preloaded database into CoreData the first time you open the app.
May be you can help me.
In the appDelegate you can change the default .xcdatamodel name to the one you added. Then xcode will load your preloaded data .sqlite file instead of the default one. You should search it up there's tutorials on this

sqlite database manager for iOS

I use this https://github.com/sanathp/DatabaseManager_For_Android sqlite manager for my android project which helps me a lot. It's a single class file that enabled me to see my database tables. So I didn't had to work blindly. I could see my database when I'm running the app on device with this manager. Is there any sqlite database manager library for iOS similar to this? I'm using swift for my project & for sqlite database I'm using Sqlite.swift project. Thanks.
Though in android you have it as a activity i kind of have a separate mac app call SqliteBrowser by which i will manage the data
Check it here: http://sqlitebrowser.org/
I would locate the sqlite file in the documents directory(Or location where you store your sqlite file) and will load the sqlite file in this manager
To check the data is inserted correctly
To insert data and check whether i can retrieve via code
The tables inserted into the DB are correct
also you can use sqdatabase sqlite database manager ı made this application for check database you can insert update browse and delete or only check your datas easy to use
link corrected sory you can check from here

No such table SQLite3

My app has a SQLite database. I don’t know how to explain, but sometimes all tables from the sqlite file gets deleted. It happen frequently. The .db file still exists but no tables.
The tables in an SQLite database (for a given path) will be removed only in these two situations:
The DROP TABLE command was executed against the database
The database file was replaced with a version that did not contain the tables.
Alternatively, the code may be creating a new database or the opening the wrong database file. If there are no tables then a new database/file was probably created. The "relative path" can play a role in where the SQLite file is opened from.
Find out which situation is occurring - and fix it.

Firefox addon: Connecting to SQLite database located in the addon's "data" folder

I am writing my first firefox add-ons using the addon-sdk.
The purpose of this add-on is to
get data from a specific page,
use this data to query the SQLite database built in the add-on,
append the results of the queries in the specific page.
I have created my SQLite database with sqlite3 and stored it as myDB.db in the "data" folder or the add-on.
But when I try to open my database it does not work.
I tried like this without any success:
// Import the needed modules
var {Cu} = require("chrome");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/FileUtils.jsm");
// Open SQLite database
let file = FileUtils.getFile(self.data, ['myDB.db']);
let mDBConn = Services.storage.openDatabase(file); // Will also create the file if it does not exist
I changed the location previously set to "ProfD" in the Mozilla storage documentation because the database is not there (or should I copy it there?).
Please tell me if I should proceed differently. I thought about SQLite because there are going to be a few queries.
From Wladimir Palant's accepted answer of "How to initialize SQLite file for Firefox add-on?"
As of Add-on SDK 1.5, extensions are no longer uncompressed upon
installation - they stay as packed XPI files on disk (which is good
for performance). SQLite needs a physical file however, not something
inside an archive.
You should use the ProfD folder to store your file. This also means that whatever data is stored in your db, remains there during upgrade or retro installation

Sqlite database modifications and app updates in iOS

I'm using a sqlite database in my iOS app. I have all its tables definitions in an .sqlite file I've placed in the "Supporting Files" group of the Xcode project, and in code I copy this file to "Documents" to be able to perform database operations. While developing, I've found that, when I need to add/remove a table or change its fields and I remove the .sqlite file from "Supporting Files" to add the new one, then I need to uninstall the app from the device or the simulator and build again to get the new database.
How could I make changes in database tables by replacing the .sqlite file without having to uninstall the app? When the app will be submitted to the App Store, will the users have to reinstall the app when a new update with changes in database is available?
EDIT. Is it possible to replace the database and to keep/copy the data the user had in the old one? Or will user loose all the stored data when downloading an app update from the Store where the .sqlite database is replaced, as if he were installing the app from scratch?
I've never submitted an app to the Store yet, I need some guidelines about how to handle app updates if I need to make changes in database tables when having such database in an .sqlite file. I'm not using Core Data.
Thanks
for it, you need to modify database by using programmatically. Means, if you want to create/add new table in database then you need to add code like Create Table.... In this case, you can't use predefine database in code.
But if you want to use database instead of writing code, then you need to rename your database and copy all old database data to new database programmatically.
Thanks

Resources