![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
clickhouse-sqlalchemy
Advanced tools
ClickHouse dialect for SQLAlchemy to ClickHouse database <https://clickhouse.yandex/>
_.
.. image:: https://img.shields.io/pypi/v/clickhouse-sqlalchemy.svg :target: https://pypi.org/project/clickhouse-sqlalchemy
.. image:: https://coveralls.io/repos/github/xzkostyan/clickhouse-sqlalchemy/badge.svg?branch=master :target: https://coveralls.io/github/xzkostyan/clickhouse-sqlalchemy?branch=master
.. image:: https://img.shields.io/pypi/l/clickhouse-sqlalchemy.svg :target: https://pypi.org/project/clickhouse-sqlalchemy
.. image:: https://img.shields.io/pypi/pyversions/clickhouse-sqlalchemy.svg :target: https://pypi.org/project/clickhouse-sqlalchemy
.. image:: https://img.shields.io/pypi/dm/clickhouse-sqlalchemy.svg :target: https://pypi.org/project/clickhouse-sqlalchemy
.. image:: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml/badge.svg :target: https://github.com/xzkostyan/clickhouse-sqlalchemy/actions/workflows/actions.yml
Documentation is available at https://clickhouse-sqlalchemy.readthedocs.io.
Supported interfaces:
clickhouse-driver <https://github.com/mymarilyn/clickhouse-driver>
asynch <https://github.com/long2ice/asynch>
Define table
.. code-block:: python
from sqlalchemy import create_engine, Column, MetaData
from clickhouse_sqlalchemy import (
Table, make_session, get_declarative_base, types, engines
)
uri = 'clickhouse+native://localhost/default'
engine = create_engine(uri)
session = make_session(engine)
metadata = MetaData(bind=engine)
Base = get_declarative_base(metadata=metadata)
class Rate(Base):
day = Column(types.Date, primary_key=True)
value = Column(types.Int32)
__table_args__ = (
engines.Memory(),
)
Rate.__table__.create()
Insert some data
.. code-block:: python
from datetime import date, timedelta
from sqlalchemy import func
today = date.today()
rates = [
{'day': today - timedelta(i), 'value': 200 - i}
for i in range(100)
]
And query inserted data
.. code-block:: python
session.execute(Rate.__table__.insert(), rates)
session.query(func.count(Rate.day)) \
.filter(Rate.day > today - timedelta(20)) \
.scalar()
ClickHouse SQLAlchemy is distributed under the MIT license <http://www.opensource.org/licenses/mit-license.php>
_.
FAQs
Simple ClickHouse SQLAlchemy Dialect
We found that clickhouse-sqlalchemy 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.