Questions tagged [sqlite-shell]

The command line interpreter / shell for the SQLite database engine.

The SQLite project provides a simple command-line program named sqlite3 (or sqlite3.exe on Windows) that allows the user to manually enter and execute SQL statements against an SQLite database.

https://www.sqlite.org/cli.html

6 questions
119
votes
11 answers

How to import load a .sql or .csv file into SQLite?

I need to dump a .sql or .csv file into SQLite (I'm using SQLite3 API). I've only found documentation for importing/loading tables, not entire databases. Right now, when I type: sqlite3prompt> .import FILENAME TABLE I get a syntax error, since…
happythenewsad
  • 1,765
  • 3
  • 15
  • 17
15
votes
3 answers

sqlite get name of attached databases

How do I get the name of the Attached databases in SQLite? I've tried looking into: SELECT name FROM sqlite_master But there doesn't seem to be any information there about the attached databases. I attach the databases with the command: ATTACH…
Bigger
  • 1,807
  • 3
  • 18
  • 28
4
votes
6 answers

How to exit dbshell (SQLite 3) on the command line when using Django?

How do I exit dbshell (SQLite 3) on the command line when using Django? It's my first time to use the command. I watch a book and am practicing Django at the same time. After I run this command, I have no idea how to leave the environment since I…
Philipl
  • 395
  • 4
  • 21
1
vote
1 answer

import csv to sqlite3, but change the type of column before import

I am working with one csv, which has many columns. I decided I'll import the data via sqlite3 shell and I found this very useful: .mode CSV .import my_table.csv my_sqlite_table This saves me a lot of work, on the other hand it gives me no control…
filtertips
  • 801
  • 3
  • 12
  • 25
1
vote
1 answer

Importing badly formed CSV into SQLite

I am trying to parse and analyse log files by importing some large CSV files with millions of lines in to SQLite. I was using my .NET program to achieve the same thing on smaller log files through LINQ with out any database. But I was facing…
Srinivas
  • 2,479
  • 8
  • 47
  • 69
0
votes
0 answers

sqlite string-literal escapes("\t") in dot-commands

There seem to be two kinds of parsers in the sqlite shell, one that interprets escape sequences only inside double quotes and only for dot-commands ("\n", e.g. for .separator), and one that doesn't, for everything else: sq3> CREATE TABLE bhist (cmd…
usretc
  • 723
  • 4
  • 9