
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
mydb is a simple db wrapper for mysql.
.. contents::
::
pip install mydb
::
from mydb.connection import Connection
db = Connection("mysql://youngking@localhost:13306/mydatabase")
for article in db.query("SELECT * FROM articles"):
print article.title
::
from mydb.router import ConnectionRouter
from mydb.proxy import DBProxy
router = ConnectionRouter(["myapp.somewhere.MasterSlaveRouter"])
db = DBProxy(router)
for article in db.query("SELECT * FROM articles"):
print article.title
Database routers
A database Router is a class that provides up to two methods:
db_for_read(statement, \**hints)
::
Suggest the database that should be used for read operations for ``SELECT`` statement.
If a database operation is able to provide any additional information that might assist in selecting a database, it will be provided in the hints dictionary. Details on valid hints are provided below.
Returns None if there is no suggestion.
db_for_write(model, \**hints)
::
Suggest the database that should be used for writes of statements except ``SELECT``.
If a database operation is able to provide any additional information that might assist in selecting a database, it will be provided in the hints dictionary. Details on valid hints are provided below.
There is an example in ``tests/test_router.py``.
A router doesn’t have to provide all these methods – it may omit one or more of them. If one of the methods is omitted,
mydb will skip that router when performing the relevant check.
In ``mydb.router`` there are some default routers, where you can inherit from and overwriten them.
Links
===============================
* `documentation <http://pythonhosted.org/mydb>`_
* `SouceCode at github <https://github.com/youngking/mydb>`_
FAQs
db wrapper for mysql
We found that mydb 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 News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.