Project

General

Profile

Actions

Feature #1124

closed
BN

Dbo: allow to bind dbo::ptr

Feature #1124: Dbo: allow to bind dbo::ptr

Added by Boris Nagaev over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
01/07/2012
Due date:
% Done:

0%

Estimated time:

Description

Hello!

Look at this code:

    Posts posts = session_.find<Post>
      ("where date >= ? "
       "and date < ? "
       "and (state = ? or author_id = ?)")
      .bind(WDateTime(lower))
      .bind(WDateTime(upper))
      .bind(Post::Published)
      .bind(session_.user().id());

and this:

       "delete from " + session_.tableName<AuthIdentityType>() +
       " where " + session_.tableName<DboType>() + "_id = ?"
       " and provider = ?").bind(user.id()).bind(provider);

Using of ptr.id() in .bind() is annoying.

Moreover, should '.id()' be forgotten, this results in bad error:
code without '.id()' is compilable and cause Segmentation fault in my case.
(This error is rather difficult to find, since code like 'session.find("friend = ?").bind(user)' looks Ok.)

Could you change .bind() method to take ptr, please?

BR.

KD Updated by Koen Deforche over 14 years ago Actions #1

  • Status changed from New to Resolved
  • Target version set to 3.2.1

Hey,

I've fixed this in git, and will push this later today.

Regards,
koen

KD Updated by Koen Deforche over 14 years ago Actions #2

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: PDF Atom