Skip to content

files generated for SQLite are missing type annotations. #64

Description

@rfletchr

When generating python code with the engine set to sqlite the generated code has every property annotated with the Any type.

If I switch the engine to postgresql everything works as expected.

version: '2'plugins:
- name: pywasm:
url: https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.2.0.wasmsha256: a6c5d174c407007c3717eea36ff0882744346e6ba991f92f71d6ab2895204c0esql:
- schema: "schema.sql"queries: "query.sql"engine: sqlitecodegen:
- out: src/modeldb/db/schemaplugin: pyoptions:
package: modeldb.db.schemaemit_sync_querier: trueemit_async_querier: truequery_parameter_limit: 5
CREATETABLEfile
(
id INTEGERNOT NULL,
name textNOT NULL,
pathtextNOT NULL,
hash textNOT NULL,
resource_id INTEGERNOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (resource_id) REFERENCES resource (id)
);
# Code generated by sqlc. DO NOT EDIT.# versions:# sqlc v1.27.0importdataclassesfromtypingimportAny, Optional@dataclasses.dataclass()classFile:
id: Anyname: Anypath: Anyhash: Anyresource_id: Any

I realise sqlite plays fast and loose with types, but so does python. It'd be very beneficial to have this working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions