
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
A simple Object Relational Mapper for MySql. Works with existing tables and the schema of the tables are automatically inferred.
pip install orm-mysql
from orm import Table
Table.connect(config_dict={
'host': '<host_here>',
'port': 3306,
'user': '<user>',
'password': '<password>',
'database': '<database>'
})
Create a class that inherits from Table
. Initialize the class variable table_name
with the name of the table, here 'student'
from orm import Table
Table.connect(config_dict=CONFIG)
class Student(Table):
table_name = 'student'
get_table()
from orm import Table, get_table
Table.connect(config_dict=CONFIG)
Student = get_table('student')
save()
new_student = Student(name='hrushi', age=19, gender='M')
new_student.age = 20
new_student.save()
create()
new_student = Student.create(name='hrushi', age=19, gender='M')
where()
students = Student.where(age=19, gender='F')
for stu in students:
print(stu.name)
find()
Find a single record based on PRIMARY KEY.
# find student where id(PK) = 2
student = Student.find(2)
print(student.name)
student = Student.find(2)
student.destroy()
has_many
and belongs_to
can be used to show relationships between tables.
from orm import Table, has_many, belongs_to
class Article(Table):
table_name = 'articles'
relations = [
belongs_to(name='author', _class='Author', foreign_key='author_id', primary_key='id')
]
class Author(Table):
table_name = 'authors'
relations = [
has_many(name='articles', _class='Article', foreign_key='author_id')
]
auth = Author.find(2)
articles = auth.articles()
for art in articles:
print(art.title)
art = Article.find(5)
author = art.author()
print(author.name)
FAQs
An ORM for MySql.
We found that orm-mysql 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.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.