[odb-users] Re: Optional PRAGMA_DB (id)

Boris Kolpackov boris at codesynthesis.com
Thu Oct 6 07:02:39 EDT 2011


Hi Viacheslav,

Вячеслав Спиридонов <art at it-gen.net> writes:

> So formulation of the problem: we need logged all visits of players.
> We will record PlayerId and Date. Us in the future there is no need to
> carry out any action which would require PRIMARY KEY.
> 
> CREATE TABLE IF NOT EXISTS `players_enter` (
>   `PlayerId` INT (10) NOT NULL,
>   `Date` date NOT NULL
> ) ENGINE = MyISAM;

Yes, I remember you asked for support for objects without ids some time
ago. I did more thinking on this feature and I believe we can probably
support this. Such objects, however, will have a number of limitations,
biggest of which is that you won't be able to update such objects using
the database::update() function. This is probably not an issue in your
case, but I just want to confirm.

Essentially, one will be able to persist such objects using the persist()
function, load them using query() (load()/find() will not be supported)
and delete such objects using erase_query() (again, normal erase() will
be unavailable). Let me know if you see any problems with these 
limitations.

Boris



More information about the odb-users mailing list