Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
a simple orm in python based on [mysql,dataclass].
pip install rinch-sql
table
task.py
import datetime
from dataclasses import dataclass
@dataclass
class User:
field_list_unique = ["name"] # must, can be []
name: str
age: int
id: int = None # must
create_time: datetime = None
update_time: datetime = None
from rinch_sql import Mysql
# please use every key with current name. dont use it autocommit(always True).
MYSQL_SERVER_DATABASE = {
"host": "",
"port": 3306,
"user": "",
"password": "",
"database": "",
"pool_size": 32,
}
from .user import User
# it will create pool immediately
mysql_user = Mysql(MYSQL_SERVER_DATABASE, User)
# or creat it when use
def mysql_user_():
return Mysql(MYSQL_SERVER_DATABASE, User)
from rinch_sql import Sql, SqlStatic
from table import mysql_user, User
# select all
user_list = mysql_user.select("")
# select with where
user_list = mysql_user.select("id = 1")
# select with complex sql
sql = "SELECT id,t1.name,age from user as t1 right join tb_mail as t2 on t1.name=t2.name group by t1.name"
values = ["id", "name", "age"] # "id,name,age".split(",")
user_record_list = mysql_user.execute(sql)
user_list = [mysql_user._values_2_obj(i, values) for i in user_record_list]
# or you can use Sql or SqlStatic driect
sql_update = SqlStatic.update("user", ["name", "age"])
user = User(id=2)
mysql_user.execute(sql_update, ["name_new", 100])
when you have any advice, please issue in https://github.com/rinch-wu/rinch_sql
FAQs
a simple orm in python based on [mysql,dataclass].
We found that rinch-sql 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.