
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
rhosocial-activerecord-mysql
Advanced tools
MySQL backend implementation for rhosocial-activerecord, providing a robust and optimized MySQL database support.
MySQL backend implementation for rhosocial-activerecord, providing a robust and optimized MySQL database support.
This package provides MySQL backend support for the rhosocial-activerecord ORM framework. It enables seamless integration with MySQL databases while leveraging all the features of the ActiveRecord pattern implementation.
Note: This is a backend implementation only and requires the main rhosocial-activerecord package to function properly.
This project is still under development and features are subject to change. Please stay tuned for the latest changes.
pip install rhosocial-activerecord-mysql
Important: This package is a MySQL backend implementation for rhosocial-activerecord and cannot work independently. You must install and use it together with the main package.
For detailed usage of the main ActiveRecord framework, please refer to the rhosocial-activerecord documentation.
from rhosocial.activerecord import ActiveRecord
from rhosocial.activerecord.backend.impl.mysql.backend import MySQLBackend
from rhosocial.activerecord.backend.typing import ConnectionConfig
from datetime import datetime
from typing import Optional
class User(ActiveRecord):
__table_name__ = 'users'
id: int
name: str
email: str
created_at: datetime
deleted_at: Optional[datetime] = None
# Configure with MySQL backend
User.configure(
ConnectionConfig(
host='localhost',
port=3306,
database='myapp',
user='dbuser',
password='dbpassword'
),
backend_class=MySQLBackend
)
# Create a table (if not exists)
User.create_table_if_not_exists()
# Create a new user
user = User(name='John Doe', email='john@example.com', created_at=datetime.now())
user.save()
# Query users
active_users = User.query() \
.where('deleted_at IS NULL') \
.order_by('created_at DESC') \
.all()
# Update user
user.name = 'Jane Doe'
user.save()
# Delete user (soft delete if implemented)
user.delete()
This backend supports MySQL-specific features and optimizations:
# Using MySQL fulltext search
results = User.query() \
.where('MATCH(name, email) AGAINST(? IN BOOLEAN MODE)', ('+John -Doe', )) \
.all()
# Using MySQL JSON operations
results = User.query() \
.where('settings->>"$.notifications" = ?', ('enabled', )) \
.all()
# Batch insert with ON DUPLICATE KEY UPDATE
User.batch_insert_or_update([user1, user2, user3])
Complete documentation is available at python-activerecord MySQL Backend
We welcome and value all forms of contributions! For details on how to contribute, please see our Contributing Guide.
Copyright © 2025 vistart
FAQs
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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.