Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
sql-smith is an SQL query builder with zero dependencies and a fluent interface.
The sentence above is, beside the name, a copy from the website of the PHP library
Latitude_, for the simple reason that this Python module is a port of Latitude.
Read the full documentation <https://fbraem.github.io/sql-smith>
_.
Installation
.. code-block:: sh
$ pip install sql-smith
Quick Start
QueryFactory is a factory to create a SELECT, INSERT, UPDATE or DELETE query. Use the fluent interface of the queries to complete the query.
.. code-block:: python
from sql_smith import QueryFactory
from sql_smith.engine import CommonEngine
from sql_smith.functions import field
factory = QueryFactory(CommonEngine())
query = factory \
.select('id', 'username') \
.from_('users') \
.where(field('id').eq(5)) \
.compile()
print(query.sql) # SELECT "id", "username" FROM "users" WHERE "id" = ?
print(query.params) # (5)
When the query is ready, compile it. The return value of compile is a Query class instance with two properties: sql and params. Use these properties to pass the query to a database.
.. code-block:: python
import sqlite3
db = sqlite3.connect('test.db')
cur = db.cursor()
for row in cur.execute(query.sql, query.params):
print(row)
Big thanks to JetBrains_ to let me use PyCharm for free!
.. _Latitude: https://latitude.shadowhand.com/ .. _JetBrains: https://www.jetbrains.com/pycharm/
FAQs
sql-smith is an SQL query builder with zero dependencies and a fluent interface.
We found that sql-smith 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.