Importing sqlite data to chrome browser - sqlite

I have got a .sqlite file which has table definition and data. I want to store this data to chrom broswer and query against it. I tried query it against the physical file but it does not seem to work. Any ideas?

You have to use JavaScript and a WebSQL database. See: http://dev.w3.org/html5/webdatabase/
But importing your file is not that easy because with WebSQL you can't read an sqlite file but WebSql is the only way for storing information via SQL in Chrome.

Related

Delphi FireDAC SQLite default database path in Windows 10

I'm building a small app with a local in memory database using Delphi 10.3 with FireDAC set to SQLite.
What is de default path to the database file that SQLite uses? (i.e. Database parameter is left blank)
I want to transfer the database file to another PC. I suppose it has the .db file extension, but I'm unable to locate the file.
from http://docwiki.embarcadero.com/RADStudio/Sydney/en/Using_SQLite_with_FireDAC:
"To create and open an SQLite in-memory database use the following
parameters:
DriverID=SQLite Database=:memory: Or just leave the Database parameter
empty:"
This made me think that there should be a file that eventually stores the data, but it turns out there is none. All data is lost after the database is free'd.
By definition "in memory" means no file. If you need a file for your data then add a filename (complete with path) to the Database value in TFDConnection's Params.
You can do it in the object inspector at design time or by code at run time it looks like:
FDConnection1.Params.Values['Database'] := 'C:\ProgramData\YourCompany\YourApp\YourFile.sqlite3';
Of course it is better to set the path by querying Windows for the location of "Program Data".

Which file to locate to see data of database in SQLite browser

I'm creating a database "UserDataBase.db" and while opening this in SQLite browser neither data nor tables is being shown if I am doing any CRUD operations then it works.I am providing images link also regarding which file I am locating in SQLite browser.First I am synchronizing these files and saving on Desktop and opening in SQLite browser.I have tried to fetch the data from the database it works fine.
As the database is just 4k and that the -wal file is 80.5k the data hasn't been written/comitted. You need to close the database or checkpoint the database and then copy the file. Or you could copy the -wal and -shm files into DB Browser open it and then close it and then re-open it.

Difference between .db and .sqlite file

Through the SQLite database manager I am able to generate a .sqlite file.
And through Java code I am able to generate a .db file (database file) in SQLite database.
What is difference between the two files?
Absolutely none. SQLite does not care the least what extension the file uses. It checks whether what it was given is indeed a SQLite3 database by inspecting the magic number and the header.
It's purely up to you whether you use the suffix .db, .sqlite, .dat, .mydata, .foo or whatever... or no extension at all; that is also permitted. There is no standard and the documentation does not seem to make any particular suggestion either, so everybody uses something else.
Also, if you are using SQLite as a storage backend for your application, it actually makes sense to use extension specific to your application. Because it is not just any random SQLite database, it is SQLite database with specific schema storing particular kind of data.

Converting sqlite to sqlite format inside Titanium Appcelerator

Here is my issue. I am using Titanium Appcelerator to build an app that accesses my database and other various things. I have two separate files. One being an et.sql file in readable format and the other et.sql file with a top line of SQLite format 3���# and the rest being ASCII or some text in an unreadable format.
var db = Ti.Database.install('et.sqlite','et');
var db = Ti.Database.open('et');
This produces an sql file that gets installed inside a folder that the app will use in the future.
When using this et.sql file with the header of SQLite format 3Ä# it is accepting it inside Titanium and the app builds with my code, the other file that is formatted it doesn't accept. It seems like it needs to be in sqlite format.
I am using SQLite Manager for Firefox to update my sqlite file with new tables, etc that in turn gets installed in Titanium that produces an sql file. Problem here is I can't seem to reproduce a sql file that is in sqlite format. The previous developer didn't leave any notes on how to do this and I've struggled to produce this file in a format that works. I've looked into using sqlite3 command line, but I've had no luck. How do I get titanium or sqlite for that matter to dump this file in sqlite format so that it can be used inside Titanium?
I am fairly new to sqlite so if I'm overseeing anything just point it out.
You can use the sqlite3 command-line tool to convert between text files containing SQL statements and SQLite database files:
sqlite3 newfile.sqlite < oldfile.sql
sqlite3 oldfile.sqlite .dump > newfile.sql

Sqlite database exception: file is encrypted or is not a database in blackberry?

I am working on a firm application in which I need to create a local database on my device.
I create my local database through create statement[ It works well]
Then I use that file and perform insert operation through fire-fox sqlite plugin, I need to insert aprox 2000 rows at a time so I can not use code. I just run insert manually through sqlite plugin in fir-fox.
After that I just use that file in my place of my local database.
When I run select query through my code, It show Exception:java.lang.Exception: Exception: In create or prepare statement in DBnet.rim.device.api.database.DatabaseException: SELECT distinct productline FROM T_Electrical ORDER BY productline: file is encrypted or is not a database
I got the solution of this problem, I was doing a silly mistake by creating a file manually by right click in my RES folder, that is not correct. We need to create the database completely from SQlite plugin, then it will work fine. "Create data base from SQLITE(FIle too) and perform insertion operation from SQLITE, then it will work fine"
This is very rare problem, but i think it might be helpful for someone like me....!:)
You should check to see if there is a version problem between the SQLite used by your Firefox installation and that on the BlackBerry. I think I had the same error when I tried to build a database file with SQLite version 2.
You also shouldn't need to create the database file on the device. To create large tables I use a Ubuntu machine and the sqlite3 command line. Create the file, create the tables, insert the data and build indexes. Then I just copy the file onto the device in the proper directory.
For me it was a simple thing. One password was set to that db. I just used it and prolem got solved.

Resources