How to Use sqlite3

Haebin Ethan Jeong·2020년 6월 15일
0

PRAGMA

PRAGMA table_info(table_name); will get you a list of all the column names.

bulk_create

We can use bulk_create for creating multiple objects in one shot.

Here is an example.

Category.objects.bulk_create(
[
    [Category(name="God"),
     Category(name="Demi God"),
     Category(name="Mortal")]
)

How to make table more readible

sqlite> .header on
sqlite> .mode column
sqlite> select * from menu_category;

How to reset and id in sqlite

delete from your_table;    
delete from sqlite_sequence where name='your_table';
profile
I'm a Junior studying Economics and Computer Science at Vanderbilt University.

0개의 댓글