https://github.com/zztkm/sqlc-python-example
https://github.com/zztkm/sqlc-python-example
python sqlc
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zztkm/sqlc-python-example
- Owner: zztkm
- Created: 2022-09-20T07:45:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-20T08:00:55.000Z (over 3 years ago)
- Last Synced: 2025-04-14T01:18:03.257Z (about 1 year ago)
- Topics: python, sqlc
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Getting started sqlc with Python
sql v1.15.0 時点では Python は PostgreSQL しかサポートされていませんでした。
MySQL と SQLite の場合、コードは生成されますが型は自分でつける必要がありそうです。
サポートについては以下を参照してください。
- https://docs.sqlc.dev/en/latest/reference/language-support.html
## SQL生成
以下を実行するには sqlc のインストールが必要です。
https://docs.sqlc.dev/en/latest/overview/install.html
```shell
# example sqlite
cd sqlite
# コマンドを実行すると db dir が上書きされます
sqlc generate
```
root から見て `sqlite/db` ディレクトリにファイルが生成されているのでそれを確認してください。
## 参考
- https://docs.sqlc.dev/en/latest/index.html
- https://docs.sqlc.dev/en/latest/reference/config.html#python