🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

sleekql

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sleekql

A light SQLite3 wrapper for easier database operations in Python.

1.0.0
PyPI
Maintainers
1

SleekQL

SleekQL is a light SQLite3 wrapper for Python, designed to execute simple operations more quickly.

Python License

🔧 Features

  • Create a database
  • Delete from database
  • Drop database
  • Fetch data from database
  • insert and update
  • Execute raw SQL

🚀 Usage

Import and setup

from SleekQL import SleekQL

# Initialize with database name or path
db = SleekQL("database.db")

Functions

# Close connection to database
db.close_connection()

# Create table
db.create_table(
  table_name="Table1",
  columns=["Column1", "Column2"],
  datatypes_constraints=["INTEGER PRIMARY KEY", "TEXT"]
)

# Insert data
db.insert(table_name="Table1", columns=["Column1", "Column2"], values=[100, "Data"])

# Fetch data and return list[dict]
db.select(table_name="Table1", columns=["*"])

# Update data
db.update(table_name="Table1", columns_values=["Column1 = 101", "Column2 = 'DATA'"])

# Delete data
db.delete(table_name="Table1", where="Column1 = 101")

# Drop table
db.drop_table(table_name="Table1")

Use raw SQL

# returns List[tuple] if needed
db.raw_sql(query="SELECT * FROM Table1")

📦 Installation

pip install sleekql

Keywords

sqlite sqlite3 database wrapper orm sleekql

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts