Sqlite3 module

Python uses sqlite3 module to work with SQLite.

Connection object - this object can be said to represent a database.

Example of creating a connection:

import sqlite3

connection = sqlite3.connect('dhcp_snooping.db')

Once you have created a connection you should create a Cursor object which is the main way to work with database.

Cursor is created from DB connection:

connection = sqlite3.connect('dhcp_snooping.db')
cursor = connection.cursor()