Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Module for simplified sqlite3 in Python

License

Notifications You must be signed in to change notification settings

romanin-rf/sqlite3worker.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

Module with basic functionality to work with SQLite3.

Installation

pip install --upgrade sqlite3w

Example

import sqlite3worker

db = sqlite3worker.SQLite3Worker("main.sqlite3") # "FILEPATH" | ":memory:"

db.create_table(
    "users",
    {
        "id": (int, True), # "id": (int, True) -> "COLON_NAME": (PYTHON_TYPE, IS_PRIMARY_KEY)
        "nick": (str, False),
        "desc": (str, False),
        "birthday": (float, False)
    }
)

db.add_data(
    "users",
    [0, "Roman", "...", 1]
)