Project

General

Profile

[DBO] How to make variable length string as primary key?

Added by Plug Gulp over 4 years ago

I have a table that stores session Id as primary key. The session Id is a JWT token. JWT token does not have a maximum length specified. So how do I make this variable length string whose maximum size is unknown as the primary key? I tried using code class="cpp">std::vector as the type for the primary key, but DBO does not support that type for primary key. What are the alternatives?

Thanks and kind regards,

~Plug


Replies (1)

RE: [DBO] How to make variable length string as primary key? - Added by Roel Standaert over 4 years ago

I don't see why a std::string wouldn't work. The size argument of Wt::Dbo::id is optional. When it defaults to -1, that's taken as unlimited.

    (1-1/1)