You could write a bridge between the database and protobufs using
reflection. It is probably simplest if each field in the protobuf
corresponds to a column in the database table. Then when processing the
result of a SQL query, you can just iterate over the columns, find the
corresponding field in the proto, and set the value to what was returned in
the query. You can do the same sort of thing to insert/update the table,
going from protobuf fields to column name/values.

On Wed, Apr 21, 2010 at 11:53 AM, ury <ury.se...@gmail.com> wrote:

> Hi,
>
> I wonder if someone has an idea for a generic way of storing protobuf
> messages in an SQL database (not as a blob, but in a way the data can
> be queried with SQL statements) and how to construct the protobuf
> messages back from the SQL database.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to proto...@googlegroups.com.
> To unsubscribe from this group, send email to
> protobuf+unsubscr...@googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/protobuf?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to