Skip to content

Instantly share code, notes, and snippets.

@psaraiva
Last active November 25, 2024 13:18
Show Gist options
  • Select an option

  • Save psaraiva/23132a7b90dd629467b8efd13fbd1b25 to your computer and use it in GitHub Desktop.

Select an option

Save psaraiva/23132a7b90dd629467b8efd13fbd1b25 to your computer and use it in GitHub Desktop.
SQLite Notes
.----------------.  .----------------.  .----------------.  .----------------.  .----------------.  .----------------. 
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| |    _______   | || |    ___       | || |   _____      | || |     _____    | || |  _________   | || |  _________   | |
| |   /  ___  |  | || |  .'   '.     | || |  |_   _|     | || |    |_   _|   | || | |  _   _  |  | || | |_   ___  |  | |
| |  |  (__ \_|  | || | /  .-.  \    | || |    | |       | || |      | |     | || | |_/ | | \_|  | || |   | |_  \_|  | |
| |   '.___`-.   | || | | |   | |    | || |    | |   _   | || |      | |     | || |     | |      | || |   |  _|  _   | |
| |  |`\____) |  | || | \  `-'  \_   | || |   _| |__/ |  | || |     _| |_    | || |    _| |_     | || |  _| |___/ |  | |
| |  |_______.'  | || |  `.___.\__|  | || |  |________|  | || |    |_____|   | || |   |_____|    | || | |_________|  | |
| |              | || |              | || |              | || |              | || |              | || |              | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
'----------------'  '----------------'  '----------------'  '----------------'  '----------------'  '----------------' 

SQLite: Comandos para o dia a dia.

Sair do console sqlite

.exit

Import data by sql file

.read <my_sql_file.sql>

SHOW DATASES

.databases

USE DATABASE

.open <file_name.db> 

SHOW TABLES

.tables

DESC TABLE

.schema <table_name>

Format output terminal

.headers on
.mode column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment