We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want to set a None value in Optional dataclass fields. But I was unable to find how to do it in documentation. This is possible?
I have a table like:
create table t( id serial primary key, name varchar not null, description text null )
running sqlc generate I got:
sqlc generate
@dataclasses.dataclass() class T: id: int name: str description: Optional[str]
But what I really wants is a default None value in description, like:
@dataclasses.dataclass() class T: id: int name: str description: Optional[str] = None
I'm using sqlc v1.27.0 (by docker) and generating python code for postgres with the config:
version: '2' plugins: - name: py wasm: url: https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.2.0.wasm sha256: a6c5d174c407007c3717eea36ff0882744346e6ba991f92f71d6ab2895204c0e sql: - schema: "schema.sql" queries: "queries.sql" engine: postgresql codegen: - out: ./model plugin: py options: package: model emit_sync_querier: true emit_async_querier: true emit_empty_slices: true
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I want to set a None value in Optional dataclass fields. But I was unable to find how to do it in documentation. This is possible?
I have a table like:
running
sqlc generate
I got:But what I really wants is a default None value in description, like:
I'm using sqlc v1.27.0 (by docker) and generating python code for postgres with the config:
The text was updated successfully, but these errors were encountered: