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.
pip install db_querybuilder
How to use Database Query Builder
It is very important to make the connection to the database that we are going to use.
New updated version 0.2.0
Now with Sqlite integration. If you will use the sqlite integration, I invite you to read the official sqlite documentation, to see the types of data that it allows to use.
from db_querybuilder import DatabaseQueryBuilder
class TestUser():
def __init__(self) -> None:
self.id = -1
self.first_name = 'Jhon'
self.last_name = 'Doe'
if __name__ == '__main__':
db = DatabaseQueryBuilder(db_user='root',db_password='',db_database='test',db_port=3306)
# Query to json
query = db.setTable('test_data').query().where(clausule='id',parameter=1).toJson()
print(query)
# Query select
query = db.select(['id','first_name']).from_('test_data').where('email','emaffini0@mlb.com').results()
print(query)
# Insert data with attributes object
user = TestUser()
query = db.insert(table='test_data',object=user)
print(query)
# Intregration with sqlite
# New version with sqlite queries
dbSqlite = DatabaseQueryBuilder(db_database='./db/hmi_creatio', driver= DatabaseDrivers.DRIVER_SQLITE.value)
dbSqlite.setTable('test_data')
query = dbSqlite.createTable(columns = ['id integer primary key autoincrement','name varchar(40)']).insert(fields=['id','name'],values=[1,'Jhon Doe'])
print(query)
query = dbSqlite.select(fields=['id','name']).toJson()
print(query)
FAQs
Library to execute query builder
We found that db-querybuilder 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.