You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to transfer a row data between different methods. During the transfer process, a certain field value in the row data may be modified. However, the fields of the structure and the fields of the database are not in one-to-one correspondence. There are two methods at this time. practice
Define a new structure specifically for transfer and modification between methods. The data of the new structure is copied from row data.
Use the same structure, which can reduce one copy.
The 0.7.4 version of sqlx does not support the simultaneous use of sqlx::FromRow and sqlx::skip, which is related to the issue, so I want to add '' as colmn_name to the sql statement to set a default value for the non-existent field. Expectation The static check passes, but an error "required for Option<std::string::String> to implement Into<std::string::String>" will be prompted. The example is as follows
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to transfer a row data between different methods. During the transfer process, a certain field value in the row data may be modified. However, the fields of the structure and the fields of the database are not in one-to-one correspondence. There are two methods at this time. practice
The 0.7.4 version of sqlx does not support the simultaneous use of sqlx::FromRow and sqlx::skip, which is related to the issue, so I want to add
'' as colmn_name
to the sql statement to set a default value for the non-existent field. Expectation The static check passes, but an error "required forOption<std::string::String>
to implementInto<std::string::String>
" will be prompted. The example is as followsBeta Was this translation helpful? Give feedback.
All reactions