
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
A Python-based database management library that supports both MySQL and SQLite. It provides an easy-to-use interface for defining tables, inserting data, searching records, updating, deleting, and more.
pip install pymysqlhelper
from database import Database, LocalDatabase
# MySQL Database Connection
mysql_db = Database(username='root', password='password', host='localhost', port=3306, database='testdb')
# SQLite Local Database
sqlite_db = LocalDatabase(db_path='local.db')
table = mysql_db.define_table("users", id=Integer, name=Text, age=Integer)
mysql_db.insert("users", id=1, name="Alice", age=25)
data = [
{"id": 2, "name": "Bob", "age": 30},
{"id": 3, "name": "Charlie", "age": 22}
]
mysql_db.bulk_insert("users", data)
users = mysql_db.search("users")
print(users) # List of all users
Search with filters:
alice = mysql_db.search("users", id=1)
print(alice)
user = mysql_db.get("users", id=1)
print(user)
mysql_db.update("users", {"id": 1}, {"age": 26})
mysql_db.delete("users", id=3)
tables = mysql_db.list_tables()
print(tables)
user_count = mysql_db.count_rows("users")
print(user_count)
distinct_ages = mysql_db.distinct_values("users", "age")
print(distinct_ages)
users_page1 = mysql_db.search_paginated("users", page=1, page_size=2)
print(users_page1)
schema = mysql_db.get_table_schema("users")
print(schema)
mysql_db.rename_table("users", "members")
mysql_db.add_column("members", "email", "TEXT")
mysql_db.drop_column("members", "email")
mysql_db.delete_table("members")
mysql_db.replicate_local_to_online(sqlite_db)
sqlite_db.replicate_online_to_local(mysql_db)
print(sqlite_db.get_column_type("users", "age"))
print(my_sql.get_column_type("users", "age"))
sqlite_db.edit_column_type("users", "age", "VARCHAR(10)")
mysql_db.edit_column_type("users", "age", "TEXT")
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
FAQs
A simple MySQL database helper for easy interactions
We found that pymysqlhelper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.