Questions tagged [sqlite]

A popular open-source embeddable (i.e. non client-server) RDBMS implemented as a C library.

SQLite is a C library that manages an in-memory or persistent database structure. It does not have a separate server, but links directly into the application. Many language bindings for SQLite are available, The Wikipedia entry has a list under the 'Features' section.

SQLite is used by a variety of commercial and open-source applications, and is developed by the SQLite consortium. The system is donated to the public domain although the consortium will grant explicit licenses.

692 questions
154
votes
9 answers

How to properly format sqlite shell output?

If I go to mysql shell and type SELECT * FROM users I get - +--------+----------------+---------------------------------+----------+-----------+--------------------+--------------------+ | USERID | NAME | EMAILID |…
Kshitiz Sharma
  • 3,237
  • 9
  • 31
  • 35
43
votes
3 answers

Is it possible to use SQLite as a client-server database?

Are there any techniques or tools to work with SQLite on a medium size/traffic/concurrency DB environment?
Maniero
  • 2,728
  • 6
  • 28
  • 29
24
votes
1 answer

Limits of SQLite

How far can one take the sqlite database from a single-user , embedded , prototype oriented db engine ?
mumtaz
  • 767
  • 1
  • 7
  • 10
12
votes
4 answers

select all rows with a minimum value

In Sqlite 3 I'm trying to figure out how to select rows based on a minimum value. I think that I'm limited by not knowing enough of the related terminology to effectively search google. The table looks like: num text num2 …
user35292
  • 123
  • 1
  • 1
  • 6
12
votes
1 answer

How to reduce size of a large SQLite database with series data

I'm considering to use SQLite database for a C# application which deals with large volumes of data series. The data is currently in several CSV files of up to 20GBs in size each and of the following format: 2019.07.31…
yaugenka
  • 445
  • 1
  • 5
  • 13
11
votes
1 answer

Working with multiple databases?

Using sqlite3 on Linux, how can one work with multiple databases? I'd like to do something like the following in database 1? sqlite3 database1.db insert into database1.mytable values (select * from database2.mytable) How do I write the SELECT…
me.at.coding
  • 213
  • 1
  • 2
  • 7
8
votes
1 answer

Enable autocomplete in an sqlite3 interactive shell

I am using sqlite3 on a machine where I can use tab completion (ie .read abc will autocomplete to .read abcdefghij.db. I would like to know how to enable this on my personal machine. Edit Both machines are ubuntu linux and the shell is bash. I…
CoatedMoose
  • 221
  • 2
  • 8
8
votes
2 answers

Need explanation SELECT query on many to many relationship

I have two tables related through another (many-to-many) This is a schema excerpt: CREATE TABLE user ( user_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL UNIQUE ); CREATE TABLE alias ( alias_id INTEGER NOT…
oneohthree
  • 83
  • 1
  • 1
  • 5
8
votes
1 answer

How to read metadata from Sqlite database

Sometimes I use SQLite database but it's quite common that I don't know anything about its structure. I need to retrieve all metadata like the name of a database or table, the data type of a column, primary keys, foreign keys, or access privileges.…
user2250152
  • 183
  • 2
  • 6
8
votes
2 answers

Is there a free software addition to SQLite available for data-replication?

I am aware of the possibility to create my own trigger(ed) solution, but I didn't want to reinvent the wheel :-)
ralf.w.
  • 183
  • 1
  • 6
8
votes
1 answer

SELECT query using an array of tuples

I can match one set of conditions like so: select ID from FOO where col1=1 and col2=2 and col3=3 But, what if I have an array, [(1,2,3), (4,5,6), (7,8,9)], how do I get the ID's in this case? To clarify, I would like a way to match each of the…
fuzz
  • 85
  • 1
  • 1
  • 4
6
votes
2 answers

How do I force SQLite to materialize a subquery?

Because SQLite sometimes evaluates functions like random() more than once if they appear in a subquery, which may be a bug, eg: select op, op from (select abs(random())%10 as op from (select 1)); 3|1 I need an easy way to force SQLite to…
Jack Douglas
  • 39,869
  • 15
  • 101
  • 176
6
votes
4 answers

How do I specify a timeout in sqlite3 from the command-line?

I have a couple basic scripts that kick out a little information while my sqlite3 DB is being populated, but about half the time the command instantly fails: $ sqlite3 outgoing.db "select * from edges where worker is not null;" Error: database is…
Nick T
  • 173
  • 1
  • 1
  • 7
5
votes
1 answer

Will my sqlite database occupy less space if I insert nulls instead of zeros

I have a table where most of the values inserted in one of the columns are 0. Should the database be smaller if I insert nulls instead of zeros?
bat_ventzi
  • 173
  • 5
5
votes
2 answers

How to use CREATE TABLE ... AS with Primary Key in SQLite

From SQLite documentation for CREATE TABLE http://www.sqlite.org/lang_createtable.html: A table created using CREATE TABLE AS has no PRIMARY KEY and no constraints of any kind. So is there any general way to create table with primary key & other…
Gea-Suan Lin
  • 375
  • 1
  • 2
  • 6
1
2 3
11 12