protoc-gen-sqlmodel
A protoc plugin for producing sqlmodel classes. Meant to manage multi-language projects with a single source of truth called protobuf. Generate SQLModel from your schema and manage your DB with alembic.
Install
Add to your project:
uv add protoc-gen-sqlmodel
Then configure like a regular buf plugin in a bug.gen.yaml file:
version: v2
inputs:
- directory: proto
plugins:
- local: protoc-gen-sqlmodel
out: gen
Usage
Run with protoc or (preferred) with uv run buf-generate.
Features
To mark a model as a table, include the following extension in your proto files:
syntax = "proto3";
package example.sqlmodel;
import "google/protobuf/descriptor.proto";
// Marks a protobuf message as a SQLModel table.
extend google.protobuf.MessageOptions {
bool table = 50001;
}
And mark the message schema as:
syntax = "proto3";
package example.models;
import "sqlmodel_extensions.proto";
message Entity {
option (example.sqlmodel.table) = true;
}
The generated SQLModel will be marked as a table and you can use it directly with alembic for DB management.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protoc_gen_sqlmodel-0.1.1.tar.gz.
File metadata
- Download URL: protoc_gen_sqlmodel-0.1.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0d01ec4e4272b3fbe0ab6b34880a24dd8949903663860ceaefcf33d7baa7c78
|
|
| MD5 |
b389792eaefbe5ae1cafe72d0c5632b1
|
|
| BLAKE2b-256 |
e44f1df44dedfb5cbdfb281cc4b4f1671c0142ff329c1d6c5b4b43d9490cc90f
|
Provenance
The following attestation bundles were made for protoc_gen_sqlmodel-0.1.1.tar.gz:
Publisher:
publish.yml on river-studio-net/protoc-gen-sqlmodel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protoc_gen_sqlmodel-0.1.1.tar.gz -
Subject digest:
d0d01ec4e4272b3fbe0ab6b34880a24dd8949903663860ceaefcf33d7baa7c78 - Sigstore transparency entry: 2766638738
- Sigstore integration time:
-
Permalink:
river-studio-net/protoc-gen-sqlmodel@cdc3a3c25df4441fbba4f77567f30482040f37b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/river-studio-net
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cdc3a3c25df4441fbba4f77567f30482040f37b9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file protoc_gen_sqlmodel-0.1.1-py3-none-any.whl.
File metadata
- Download URL: protoc_gen_sqlmodel-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f8d728958a9018d11e2dfaa95189154c12c6299a84878dc9f2c13ed6560cab4
|
|
| MD5 |
c5249544bad5b70d9c4ca4979e41a26c
|
|
| BLAKE2b-256 |
c4e9973260ed6424cbf72422e7b99a42fa25bb58426a678f1cee102671f2acb2
|
Provenance
The following attestation bundles were made for protoc_gen_sqlmodel-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on river-studio-net/protoc-gen-sqlmodel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
protoc_gen_sqlmodel-0.1.1-py3-none-any.whl -
Subject digest:
8f8d728958a9018d11e2dfaa95189154c12c6299a84878dc9f2c13ed6560cab4 - Sigstore transparency entry: 2766639105
- Sigstore integration time:
-
Permalink:
river-studio-net/protoc-gen-sqlmodel@cdc3a3c25df4441fbba4f77567f30482040f37b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/river-studio-net
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cdc3a3c25df4441fbba4f77567f30482040f37b9 -
Trigger Event:
push
-
Statement type: