Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
A lightweight Python library for managing asynchronous connections to SQL Server databases, designed for modern Python applications requiring robust, reusable, and efficient database management.
This library simplifies SQL Server database interactions using SQLAlchemy's async capabilities and aioodbc. It provides decorators for managing connections, commits, and rollbacks, ensuring clean and consistent database handling across your projects.
To install the library, run:
pip install async-sqlserver-lib
If you're using pipenv for dependency management:
pipenv install async-sqlserver-lib
The library allows you to manage asynchronous SQL Server connections with ease. Follow the steps below to start using it:
To configure your SQL Server connection, create a .env
file in your project root with the following details:
DB_DRIVER=ODBC Driver 17 for SQL Server
DB_USER=your_username
DB_PASS=your_password
DB_HOST=localhost
DB_PORT=1433
DB_NAME=your_database
Here’s an example of fetching data from a SQL Server database using the library:
import asyncio
from async_sqlserver_lib.decorators import create_db_connection, close_db_connection
from sqlalchemy import text
@create_db_connection(
driver="ODBC Driver 17 for SQL Server",
user="your_username",
password="your_password",
host="localhost",
port=1433,
database="your_database",
)
@close_db_connection
async def fetch_data(db_manager=None):
"""
Fetch data from the SQL Server database.
"""
async with db_manager.get_session() as session:
query = text("SELECT TOP 5 * FROM your_table") # Replace `your_table` with your table name
result = await session.execute(query)
return result.fetchall()
# Run your asynchronous function
async def main():
data = await fetch_data()
print("Fetched data:", data)
asyncio.run(main())
Install testing dependencies:
pip install pytest pytest-asyncio
Execute all tests with:
pytest
The test suite validates:
For questions, issues, or contributions, please open an issue or pull request in the GitHub repository.
This library builds upon the powerful features of:
FAQs
A Python library for managing asynchronous SQL Server connections.
We found that async-sqlserver-lib 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 a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.