
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
snowflake-sqlalchemy-json
Advanced tools
This is a library to handle JSON data in snowflake-sqlalchemy.
$ pip install snowflake-sqlalchemy-json
Note that the current version support SELECT of JSON columns, but it does not support INSERT or UPDATE of them.
This library supports access to elements in JSON columns.
You can access JSON columns as follows:
JSON
type.VARIANT
, you have to use JSON
instead.dict
.Book
has a JSON column, json_data
, you can refer to an element in the column as Book.json_data["key"]
.func.flatten
function to flatten values in a JSON column.import snowflake_sqlalchemy_json
from sqlalchemy import Column, Integer, JSON, String, func, select
from sqlalchemy.orm import declarative_base, DeclarativeMeta
from sqlalchemy.sql import quoted_name
# You have to call this function to enable `func.flatten`.
snowflake_sqlalchemy_json.register_json_handler()
Base: DeclarativeMeta = declarative_base()
class Book(Base):
__tablename__ = quoted_name("database_name.schema_name.books", False)
id = Column(Integer, primary_key=True)
title = Column(String(255))
json_data = Column(JSON)
editors = func.flatten(Book.json_data["editors"]).lateral()
query = select(
Book.title,
editors.c.value["name"],
).select_from(Book).join(
editors,
True,
).where(
editors.c.value["type"] == "chief",
).order_by(editors.c.value["name"].desc())
query
in the above example generates the following SQL.
SELECT database_name.schema_name.books.title, GET(anon_2.value, 'name') AS anon_1
FROM database_name.schema_name.books JOIN LATERAL flatten(INPUT => (GET(database_name.schema_name.books.json_data, 'editors'))) AS anon_2 ON true
WHERE GET(anon_2.value, 'type') = 'chief' ORDER BY GET(anon_2.value, 'name') DESC
FAQs
A library to handle JSON with snowflake-sqlalchemy.
We found that snowflake-sqlalchemy-json 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
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.