File size: 782 Bytes
7288748
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Simple script to create a sqlite db with a single table
called 'videos'.
"""

import sqlite3

def create_db(db_path: str) -> None:
    """Create an sqlite db with a single table called 'videos'"""
    connection = sqlite3.connect(db_path)
    print(f"Created db successfully at '{db_path}'")
    connection.execute(
        '''
        CREATE TABLE VIDEO
        (ID INTEGER     PRIMARY KEY     AUTOINCREMENT,
        CHANNEL_NAME    CHAR(30)        NOT NULL,
        URL             TEXT            NOT NULL,
        TITLE           CHAR(100),
        DESCRIPTION     CHAR(5000),
        TRANSCRIPTION   TEXT,
        SEGMENTS        TEXT         
        )
        '''
    )
    print(f"'Video' table created successfully")

if __name__ == "__main__":
    create_db("video.db")