| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| @dataclasses.dataclass() | ||
| class Author: | ||
| id: int | ||
| class_: str |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.29.0 | ||
| # source: query.sql | ||
| from typing import Optional | ||
|
|
||
| import sqlalchemy | ||
| import sqlalchemy.ext.asyncio | ||
|
|
||
| from db import models | ||
|
|
||
|
|
||
| GET_AUTHOR = """-- name: get_author \\:one | ||
| SELECT id, class FROM authors | ||
| WHERE id = :p1 LIMIT 1 | ||
| """ | ||
|
|
||
|
|
||
| class Querier: | ||
| def __init__(self, conn: sqlalchemy.engine.Connection): | ||
| self._conn = conn | ||
|
|
||
| def get_author(self, *, id: int) -> Optional[models.Author]: | ||
| row = self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id}).first() | ||
| if row is None: | ||
| return None | ||
| return models.Author( | ||
| id=row[0], | ||
| class_=row[1], | ||
| ) | ||
|
|
||
|
|
||
| class AsyncQuerier: | ||
| def __init__(self, conn: sqlalchemy.ext.asyncio.AsyncConnection): | ||
| self._conn = conn | ||
|
|
||
| async def get_author(self, *, id: int) -> Optional[models.Author]: | ||
| row = (await self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id})).first() | ||
| if row is None: | ||
| return None | ||
| return models.Author( | ||
| id=row[0], | ||
| class_=row[1], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- name: GetAuthor :one | ||
| SELECT * FROM authors | ||
| WHERE id = $1 LIMIT 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE authors ( | ||
| id BIGSERIAL PRIMARY KEY, | ||
| class text NOT NULL | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| version: "2" | ||
| plugins: | ||
| - name: py | ||
| wasm: | ||
| url: file://../../../../bin/sqlc-gen-python.wasm | ||
| sha256: "24b0da217e85c9b952a4c746476aa761e9b293a4a68bef8409d97edc1c003016" | ||
| sql: | ||
| - schema: schema.sql | ||
| queries: query.sql | ||
| engine: postgresql | ||
| codegen: | ||
| - plugin: py | ||
| out: db | ||
| options: | ||
| package: db | ||
| emit_sync_querier: true | ||
| emit_async_querier: true | ||
| emit_pydantic_models: false |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import pydantic | ||
| from typing import Optional | ||
|
|
||
|
|
||
| class Author(pydantic.BaseModel): | ||
| model_config = pydantic.ConfigDict( | ||
| validate_by_alias=True, | ||
| validate_by_name=True, | ||
| ) | ||
| id: int | ||
| name: str | ||
| bio: Optional[str] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.29.0 | ||
| import pydantic | ||
|
|
||
|
|
||
| class Author(pydantic.BaseModel): | ||
| model_config = pydantic.ConfigDict( | ||
| validate_by_alias=True, | ||
| validate_by_name=True, | ||
| ) | ||
| id: int | ||
| class_: str = pydantic.Field( | ||
| alias="class", | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.29.0 | ||
| # source: query.sql | ||
| from typing import Optional | ||
|
|
||
| import sqlalchemy | ||
| import sqlalchemy.ext.asyncio | ||
|
|
||
| from db import models | ||
|
|
||
|
|
||
| GET_AUTHOR = """-- name: get_author \\:one | ||
| SELECT id, class FROM authors | ||
| WHERE id = :p1 LIMIT 1 | ||
| """ | ||
|
|
||
|
|
||
| class Querier: | ||
| def __init__(self, conn: sqlalchemy.engine.Connection): | ||
| self._conn = conn | ||
|
|
||
| def get_author(self, *, id: int) -> Optional[models.Author]: | ||
| row = self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id}).first() | ||
| if row is None: | ||
| return None | ||
| return models.Author( | ||
| id=row[0], | ||
| class_=row[1], | ||
| ) | ||
|
|
||
|
|
||
| class AsyncQuerier: | ||
| def __init__(self, conn: sqlalchemy.ext.asyncio.AsyncConnection): | ||
| self._conn = conn | ||
|
|
||
| async def get_author(self, *, id: int) -> Optional[models.Author]: | ||
| row = (await self._conn.execute(sqlalchemy.text(GET_AUTHOR), {"p1": id})).first() | ||
| if row is None: | ||
| return None | ||
| return models.Author( | ||
| id=row[0], | ||
| class_=row[1], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- name: GetAuthor :one | ||
| SELECT * FROM authors | ||
| WHERE id = $1 LIMIT 1; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE TABLE authors ( | ||
| id BIGSERIAL PRIMARY KEY, | ||
| class text NOT NULL | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| version: '2' | ||
| plugins: | ||
| - name: py | ||
| wasm: | ||
| url: file://../../../../bin/sqlc-gen-python.wasm | ||
| sha256: "24b0da217e85c9b952a4c746476aa761e9b293a4a68bef8409d97edc1c003016" | ||
| sql: | ||
| - schema: schema.sql | ||
| queries: query.sql | ||
| engine: postgresql | ||
| codegen: | ||
| - plugin: py | ||
| out: db | ||
| options: | ||
| package: db | ||
| emit_sync_querier: true | ||
| emit_async_querier: true | ||
| emit_pydantic_models: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # Code generated by sqlc. DO NOT EDIT. | ||
| # versions: | ||
| # sqlc v1.28.0 | ||
| # sqlc v1.29.0 | ||
| import dataclasses | ||
|
|
||
|
|
||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityThis change breaks the test logic. The error message should show diff (the actual difference between want and got) to help debug test failures, not got (the raw output). This makes it harder to understand what went wrong when tests fail.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.