@@ -58,23 +58,44 @@ class Example(SQLModel, table=True):
58
58
default = "John Doe" ,
59
59
alias = "full_name" ,
60
60
primary_key = True ,
61
- max_length = 128 )
62
- age : Optional [int ] = Field (description = "Age of the example" , default = 30 , alias = "years" )
63
- emails : Optional [List [str ]] = Field (description = "Emails of the example" , default = [])
64
- examples : Optional [List [Example2 ]] = Field (description = "Nested message" , default = [], sa_column = Column (JSON ))
65
- entry : Optional [Dict [str , Any ]] = Field (description = "Properties of the example" , default = {}, sa_column = Column (JSON ))
66
- nested : Optional [Nested ] = Field (description = "Nested message" , sa_column = Column (JSON ))
61
+ max_length = 128 ,
62
+ sa_column_kwargs = {
63
+ 'comment' : '"Name of the example"' })
64
+ age : Optional [int ] = Field (
65
+ description = "Age of the example" ,
66
+ default = 30 ,
67
+ alias = "years" ,
68
+ sa_column_kwargs = {
69
+ 'comment' : '"Age of the example"' })
70
+ emails : Optional [List [str ]] = Field (description = "Emails of the example" , default = [],
71
+ sa_column_kwargs = {'comment' : '"Emails of the example"' })
72
+ examples : Optional [List [Example2 ]] = Field (description = "Nested message" , default = [], sa_column = Column (
73
+ JSON ), sa_column_kwargs = {'comment' : '"Nested message"' })
74
+ entry : Optional [Dict [str , Any ]] = Field (description = "Properties of the example" , default = {}, sa_column = Column (
75
+ JSON ), sa_column_kwargs = {'comment' : '"Properties of the example"' })
76
+ nested : Optional [Nested ] = Field (
77
+ description = "Nested message" ,
78
+ sa_column = Column (JSON ),
79
+ sa_column_kwargs = {
80
+ 'comment' : '"Nested message"' })
67
81
created_at : datetime .datetime = Field (
68
- description = "Creation date of the example" ,
69
- default = datetime .datetime .now (),
70
- schema_extra = {
71
- 'required' : True })
82
+ description = "Creation date of the example" , default = datetime .datetime .now (), schema_extra = {
83
+ 'required' : True }, sa_column_kwargs = {
84
+ 'comment' : '"Creation date of the example"' })
72
85
type : Optional [ExampleType ] = Field (
73
86
description = "Type of the example" ,
74
87
default = ExampleType .TYPE1 ,
75
88
sa_column = Column (
76
- Enum [ExampleType ]))
77
- score : Optional [float ] = Field (description = "Score of the example" , default = 0.0 , le = 100.0 , sa_type = Integer )
89
+ Enum [ExampleType ]),
90
+ sa_column_kwargs = {
91
+ 'comment' : '"Type of the example"' })
92
+ score : Optional [float ] = Field (
93
+ description = "Score of the example" ,
94
+ default = 0.0 ,
95
+ le = 100.0 ,
96
+ sa_type = Integer ,
97
+ sa_column_kwargs = {
98
+ 'comment' : '"Score of the example"' })
78
99
79
100
def to_protobuf (self ) -> _message .Message :
80
101
_proto = pool .FindMessageTypeByName ("pydantic_example.Example" )
0 commit comments