Questions tagged [sqlite]

SQLite is an open-source software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

SQLite is a relational database management system contained in a small (~350 KB) C programming library. In contrast to other database management systems, SQLite is not a separate process that is accessed from the client application, but an integral part of it.

SQLite is ACID-compliant and implements most of the SQL standard, using a dynamically and weakly typed SQL syntax that does not guarantee the domain integrity.

Making an MRE for SQLite questions on StackOverflow

Providing a minimal reproducible example for an SQLite-related question is most usefully and conveniently done by showing a few lines in SQLite syntax (i.e. some create table ... and insert ... which makes a tailored toy database with appropriate structure and sample data). Also consider making a db fiddle and sharing the link (there are multiple free such services out there; see, for example, this and this).

This way, potential answerers can easily recreate the database you used for demonstrating the problem and quickly and efficiently provide solution proposals that are supported by test runs and test output. Showing pictures of database viewers or table representations (even in ASCII art) does not provide the same benefits.

When seeking assistance with an SQL query, structure your query accordingly (see tips for asking a good SQL question).

If you already have created a database for demonstration purposes, consider using the .dump command of the SQLite commandline tool. It will automatically give you the lines for exactly recreating the database.

Getting familiar with the commandline tool also is a good way of avoiding all potential errors in whatever programming language is used to handle the database. With the commandline tool, you can inspect and analyse data and structure directly.

Mobile Apps

SQlite is commonly used to store data on Android, iOS, and Windows Phone apps since it has a simple implementation, easy to adapt, and quite fast.

Design

Unlike client-server database management systems, the SQLite engine has no standalone processes with which the application program communicates. Instead, the SQLite library is linked in and thus becomes an integral part of the application program.

The application program uses SQLite's functionality through simple function calls, which reduce latency in database access: function calls within a single process are more efficient than inter-process communication. SQLite stores the entire database as a single cross-platform file on a host machine.

References

Books

94030 questions
15
votes
3 answers

How to convert sqlite2 to sqlite3 and what are the differences between both versions?

I need to convert from sqlite2 db to sqlite3, is there any tutorial that shows how to do it? And if I migrate correctly what to expect as I start the project?
Mustafa Güven
  • 15,526
  • 11
  • 63
  • 83
15
votes
5 answers

Android Save images to SQLite or SDCard or memory

I need to fetch images and some other data from server and then display it in the List. But as the number of records can be pretty large so I am not sure if I should save images to SQLite database or save it to SDCard or save those to memory.…
nilMoBile
  • 1,932
  • 4
  • 15
  • 20
15
votes
2 answers

Locking a sqlite3 database in Python (re-asking for clarification)

A few weeks ago, I posted this question on SO regarding how to lock a sqlite3 database in python: How to lock a sqlite3 database in Python? However, I'm not quite convinced that the answer works. Or, maybe I'm just misunderstanding the…
Stephen Gross
  • 5,274
  • 12
  • 41
  • 59
15
votes
3 answers

Android SQLite DB notifications

I am writing an Android app that needs to be notified whenever a given SQLite database changes (any new row added, deleted or updated). Is there any programmatic way to listen to these notifications ? Is writing DB triggers for each table the only…
Sriram
  • 1,174
  • 2
  • 9
  • 11
15
votes
1 answer

How to get the Timestamp column value in android via cursor?

How do I get the Timestamp value from database column via a cursor and store it in a Timestamp variable in android sdk? I'm using the java.sql.Timestamp and the value in the sqlite database is of type TIMESTAMP. I have created an class having all…
Abhishek
  • 1,459
  • 3
  • 19
  • 35
15
votes
3 answers

SQLite: autoincrement primary key questions

I have the following SQLite query: CREATE TABLE Logs ( Id integer IDENTITY (1, 1) not null CONSTRAINT PKLogId PRIMARY KEY, ... IDENTITY (1, 1) -> What does this mean? PKLogId what is this? This doesn't seem to be defined anywhere I want Id to…
Caner
  • 57,267
  • 35
  • 174
  • 180
15
votes
2 answers

SQLite database maximum storage capacity

How many records in an SQLite database can we maximally store? Is there any limitation? If the data goes beyond this limitation what type of error does it give? Will the whole the system fail, or what else happens?
Prem Singh Bist
  • 1,273
  • 5
  • 22
  • 37
15
votes
1 answer

Delete rows with inner join?

I have a SQLITE database with two tables. Table A has an integer timestamp and another integer column containing a row id referring to a row in table B which has two timestamps. I want to delete all rows in table A where it's timestamp does not lie…
Max Mumford
  • 2,482
  • 5
  • 28
  • 40
15
votes
2 answers

Only allow unique data entry with Android SQLite?

Before I get into describing by problem I'd like to point out I am aware of the other threads asking this question, however none for me have been able to solve my issue. I've been working on a sharing app using the BumpAPI, which upon receiving the…
Broak
  • 4,161
  • 4
  • 31
  • 54
15
votes
3 answers

Android - Can SQLite Cursor's be used after closing the database?

First of all, correct me if I'm wrong, but if you close a database connection, you can't use the Cursor you got from it, correct? db.open(); Cursor c = db.query(true, "MyTable", columns, null, null, null, null, null, null); db.close(); // The…
Jake Wilson
  • 88,616
  • 93
  • 252
  • 370
15
votes
3 answers

Sqlite3: Disabling primary key index while inserting?

I have an Sqlite3 database with a table and a primary key consisting of two integers, and I'm trying to insert lots of data into it (ie. around 1GB or so) The issue I'm having is that creating primary key also implicitly creates an index, which in…
Dimitri Tcaciuc
  • 5,053
  • 5
  • 20
  • 22
15
votes
3 answers

Is it possible to open a locked sqlite database in read only mode?

I'd like to open the chromium site data (in ~/.config/chromium/Default) with python-sqlite3 but it gets locked whenever chromium is running, which is understandable since transactions may be made. Is there a way to open it in read-only mode,…
ladaghini
  • 898
  • 1
  • 11
  • 22
15
votes
4 answers

How to install Sqlite3 on Mac OS X Lion

I am having a hell of a time getting SQLite3 installed. I have gotten all the latest stuff in terms of Ruby and Rails, the gems, etc. Everything says "Nothing to update". But when I try to install the DB I have the following error: Building native…
Matt
  • 5,542
  • 14
  • 48
  • 59
15
votes
3 answers

How do I use SQLite to read data from the Firefox cookies file?

In my Firefox profile directory there is a cookies.sqlite file which holds the data for Firefox's cookies. I grabbed the Firefox SQLite Manager extension and loaded this file, which works, but how can I use plain query commands to read the cookies…
cwd
  • 53,018
  • 53
  • 161
  • 198
15
votes
2 answers

How to save images into Database

I'd like to know if there's a way to save Images (of the type .gif) to the sqllite-database. If yes how should my DatabaseAdapter look like. Also is there a performance issue?
safari
  • 7,565
  • 18
  • 56
  • 82
1 2 3
99
100