Title: files generated for SQLite are missing type annotations. · Issue #64 · sqlc-dev/sqlc-gen-python · GitHub
Open Graph Title: files generated for SQLite are missing type annotations. · Issue #64 · sqlc-dev/sqlc-gen-python
X Title: files generated for SQLite are missing type annotations. · Issue #64 · sqlc-dev/sqlc-gen-python
Description: 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: py wasm: url: h...
Open Graph Description: 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. versi...
X Description: 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. versi...
Opengraph URL: https://github.com/sqlc-dev/sqlc-gen-python/issues/64
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"files generated for SQLite are missing type annotations.","articleBody":"When generating python code with the engine set to sqlite the generated code has every property annotated with the Any type.\r\n\r\nIf I switch the engine to postgresql everything works as expected.\r\n\r\n```yaml\r\nversion: '2'\r\nplugins:\r\n - name: py\r\n wasm:\r\n url: https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.2.0.wasm\r\n sha256: a6c5d174c407007c3717eea36ff0882744346e6ba991f92f71d6ab2895204c0e\r\nsql:\r\n - schema: \"schema.sql\"\r\n queries: \"query.sql\"\r\n engine: sqlite\r\n codegen:\r\n - out: src/modeldb/db/schema\r\n plugin: py\r\n options:\r\n package: modeldb.db.schema\r\n emit_sync_querier: true\r\n emit_async_querier: true\r\n query_parameter_limit: 5\r\n```\r\n\r\n```sql\r\nCREATE TABLE file\r\n(\r\n id INTEGER NOT NULL,\r\n name text NOT NULL,\r\n path text NOT NULL,\r\n hash text NOT NULL,\r\n resource_id INTEGER NOT NULL,\r\n PRIMARY KEY (id),\r\n FOREIGN KEY (resource_id) REFERENCES resource (id)\r\n);\r\n```\r\n\r\n```python\r\n# Code generated by sqlc. DO NOT EDIT.\r\n# versions:\r\n# sqlc v1.27.0\r\nimport dataclasses\r\nfrom typing import Any, Optional\r\n\r\n\r\n@dataclasses.dataclass()\r\nclass File:\r\n id: Any\r\n name: Any\r\n path: Any\r\n hash: Any\r\n resource_id: Any\r\n```\r\n\r\nI realise sqlite plays fast and loose with types, but so does python. It'd be very beneficial to have this working. ","author":{"url":"https://github.com/rfletchr","@type":"Person","name":"rfletchr"},"datePublished":"2024-11-27T00:46:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/64/sqlc-gen-python/issues/64"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e6dbf5c4-d699-5daf-41bd-9004c1ab0db4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98A8:274771:6CBFD98:8F76A93:696DCC72 |
| html-safe-nonce | 813232142b5695657d7051af3ecbbfd1c24bfa9226f0aeb5bf45f97fd67c677d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEE4OjI3NDc3MTo2Q0JGRDk4OjhGNzZBOTM6Njk2RENDNzIiLCJ2aXNpdG9yX2lkIjoiOTAzOTY0ODM4NzI2NjEwNDQzNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a4cc8d585c07ded0de62c1512b58b3eee323ddd2de117b27876c8b2be325f2c7 |
| hovercard-subject-tag | issue:2696575687 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/sqlc-dev/sqlc-gen-python/64/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c22fc55616f93bee218afd76089f576a0298f56ae31308e3750c244acd121b38/sqlc-dev/sqlc-gen-python/issues/64 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c22fc55616f93bee218afd76089f576a0298f56ae31308e3750c244acd121b38/sqlc-dev/sqlc-gen-python/issues/64 |
| og:image:alt | 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. versi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rfletchr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4922b452d03cd8dbce479d866a11bc25b59ef6ee2da23aa9b0ddefa6bd4d0064 |
| turbo-cache-control | no-preview |
| go-import | github.com/sqlc-dev/sqlc-gen-python git https://github.com/sqlc-dev/sqlc-gen-python.git |
| octolytics-dimension-user_id | 136738596 |
| octolytics-dimension-user_login | sqlc-dev |
| octolytics-dimension-repository_id | 548530161 |
| octolytics-dimension-repository_nwo | sqlc-dev/sqlc-gen-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 548530161 |
| octolytics-dimension-repository_network_root_nwo | sqlc-dev/sqlc-gen-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7e5ae23c70136152637ceee8d6faceb35596ec46 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width