샘플
sqlalchemy 2.0.51: sql.elements.ColumnClause
검증된 샘플 — pypi sqlalchemy 2.0.51: sql.elements.ColumnClause. python 3.12 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: ColumnClause represents a…
sha256:c229ae0504ad150bd71c7e2a79f317899d3782bbeffb2e504f8fca32594b15ba
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
python linux 24 · ubuntu · glibc 2.39 x64 python python pip
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| python 3.12 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1python:3.12-slim@sha256:09f7da3bc104… |
2026-09-07 |
케이스
HOW- 목표
- verify sqlalchemy.sql.elements.ColumnClause in pkg:pypi/sqlalchemy@2.0.51
- 심벌
-
- sqlalchemy.sql.elements.ColumnClause
- 환경
- python
- 생성일
- 2026-09-07T02:49:03Z
컨트랙트
- ColumnClause represents a lightweight textual column expression with optional type specification and name.
- ColumnClause supports comparison and logical operators producing SQL binary expressions.
- ColumnClause supports aliasing via label() and sorting modifiers via asc() and desc().
- ColumnClause with is_literal=True renders raw textual SQL expressions directly without quoting.
- ColumnClause integrates with table constructs and executes within select statements against a database.
파일
- NOTES.md
- PROMPT.md
- csx.json
- requirements.txt
- spec.json
- test/contract.py
소스
# sqlalchemy.sql.elements.ColumnClause API
This sample pins `sqlalchemy` 2.0.51 and verifies `sqlalchemy.sql.elements.ColumnClause` for lightweight column expressions and table representations.
The contract verifies:
- `ColumnClause` represents a lightweight textual column expression with optional type specification and name.
- `ColumnClause` supports comparison and logical operators producing SQL binary expressions.
- `ColumnClause` supports aliasing via `label()` and sorting modifiers via `asc()` and `desc()`.
- `ColumnClause` with `is_literal=True` renders raw textual SQL expressions directly without quoting.
- `ColumnClause` integrates with `table` constructs and executes within `select` statements against a database.
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify sqlalchemy.sql.elements.ColumnClause in pkg:pypi/sqlalchemy@2.0.51
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:pypi/sqlalchemy@2.0.51
Demonstrate these symbols/APIs:
- sqlalchemy.sql.elements.ColumnClause
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:4459e5f89c236266ba68e25414c3c130f1dfd453c215ed9169c3a8c7309c5d8c","contract":["ColumnClause represents a lightweight textual column expression with optional type specification and name.","ColumnClause supports comparison and logical operators producing SQL binary expressions.","ColumnClause supports aliasing via label() and sorting modifiers via asc() and desc().","ColumnClause with is_literal=True renders raw textual SQL expressions directly without quoting.","ColumnClause integrates with table constructs and executes within select statements against a database."],"goal":"verify sqlalchemy.sql.elements.ColumnClause in pkg:pypi/sqlalchemy@2.0.51","kind":"HOW","packages":["pkg:pypi/sqlalchemy@2.0.51"],"schemaVersion":1,"symbols":["sqlalchemy.sql.elements.ColumnClause"]},"contractCommand":["python","test/contract.py"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"pypi","executionContext":"python","language":"python","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"pip","runtime":"python","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/sqlalchemy@2.0.51"],"schemaVersion":1,"subject":"pkg:pypi/sqlalchemy@2.0.51","symbols":["sqlalchemy.sql.elements.ColumnClause"],"verifierAdapter":"python@1"}
sqlalchemy==2.0.51
{
"schemaVersion": 1,
"goal": "verify sqlalchemy.sql.elements.ColumnClause in pkg:pypi/sqlalchemy@2.0.51",
"kind": "HOW",
"packages": [
"pkg:pypi/sqlalchemy@2.0.51"
],
"symbols": [
"sqlalchemy.sql.elements.ColumnClause"
]
}
import sqlalchemy
from sqlalchemy.sql.elements import ColumnClause
from sqlalchemy import (
column,
literal_column,
table,
Integer,
String,
select,
create_engine,
text,
)
# 1. ColumnClause represents a lightweight textual column expression with optional type specification and name.
col1 = ColumnClause("id", Integer)
assert isinstance(col1, ColumnClause), f"Expected ColumnClause, got {type(col1)}"
assert col1.name == "id"
assert col1.key == "id"
assert str(col1.type) == "INTEGER"
# Factory function column() returns a ColumnClause instance
col2 = column("username", String(50))
assert isinstance(col2, ColumnClause)
assert col2.name == "username"
assert str(col2.type) == "VARCHAR(50)"
# 2. ColumnClause supports comparison and logical operators producing SQL binary expressions.
eq_expr = (col1 == 42)
assert str(eq_expr) == "id = :id_1"
gt_expr = (col1 > 10)
assert str(gt_expr) == "id > :id_1"
in_expr = (col1.in_([1, 2, 3]))
assert "id IN (" in str(in_expr)
is_null = col1.is_(None)
assert str(is_null) == "id IS NULL"
is_not_null = col1.is_not(None)
assert str(is_not_null) == "id IS NOT NULL"
# 3. ColumnClause supports aliasing via label() and sorting modifiers via asc() and desc().
labeled = col1.label("user_id")
assert labeled.name == "user_id"
assert str(col1.asc()) == "id ASC"
assert str(col1.desc()) == "id DESC"
# 4. ColumnClause with is_literal=True renders raw textual SQL expressions directly without quoting.
lit_col = ColumnClause("count(*)", is_literal=True)
assert lit_col.is_literal is True
assert str(lit_col) == "count(*)"
lit_func = literal_column("NOW()")
assert isinstance(lit_func, ColumnClause)
assert lit_func.is_literal is True
assert str(lit_func) == "NOW()"
# 5. ColumnClause integrates with table constructs and executes within select statements against a database.
tbl_id = ColumnClause("id", Integer)
tbl_name = ColumnClause("username", String)
users_table = table("users", tbl_id, tbl_name)
assert tbl_id.table is users_table
assert tbl_name.table is users_table
assert list(users_table.c.keys()) == ["id", "username"]
engine = create_engine("sqlite:///:memory:")
with engine.connect() as conn:
conn.execute(text("CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT)"))
conn.execute(text("INSERT INTO users (id, username) VALUES (1, 'alice'), (2, 'bob')"))
# Query using standalone ColumnClause with explicit select_from
standalone_col = ColumnClause("username", String)
stmt1 = select(standalone_col).select_from(text("users")).where(standalone_col == "alice")
res1 = conn.execute(stmt1).scalar_one()
assert res1 == "alice"
# Query using table-bound ColumnClause attributes
stmt2 = select(users_table.c.id, users_table.c.username).where(users_table.c.id == 2)
row = conn.execute(stmt2).one()
assert row.id == 2
assert row.username == "bob"
print("CONTRACT PASS: sqlalchemy.sql.elements.ColumnClause verified offline")
오리진 시더
익명