
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
A lightweight wrapper around psycopg2 for creating queries using a builder pattern.
Example Query:
Using pip
pip install git+https://github.com/MeadowlarkEngineering/query-builder.git#egg=query-builder
Using poetry
poetry add git+https://github.com/MeadowlarkEngineering/query-builder.git
Select everything from a table.
from query_builder import PostgresConfig, Select
config = PostgresConfig(dbname="blog", user="postgres-username", password="postgres-password)
Select("comments").execute(config)
> [{'id': 1, 'text': "A comment"}]
Add joins, multiple where clauses, offsets, and limits.
s = Select(table_name="posts").\
join(left_table="posts", right_table="authors", left_col="author_id", right_col="id").\
where(table="authors", column="id", operator="=", value=1).\
where_and(table="authors", column="created_at", operator=">", value="2024-01-01").\
where_and(table="authors", column="created_at", operator=">", value="2024-01-01").\
limit(10).\
offset(5).\
order_by("created_at", table="posts")
result = s.execute(config)
Insert data
i = Insert(table_name="posts").values([{"author_id": 1, "body": "this is a post"}]).on_conflict('id', 'update')
result = i.execute(config)
pip3 install --upgrade pip poetry
poetry self add "poetry-dynamic-versioning[plugin]"
poetry install
Start a postgres database. The tests don't modify the database, but do require an active psycopg2 connection.
docker run -d -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres
Run the unit tests
poetry run pytest
You may need to set PGUSER, PGDATABASE, and PGPASSWORD environment variables to establish the connection
Copyright 2024 - Meadowlark Engineering
FAQs
A lightweight Non-ORM with a builder pattern for querying a postgres database
We found that sqlark 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
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.