Project

General

Profile

Actions

Feature #1124

closed

Dbo: allow to bind dbo::ptr

Added by Boris Nagaev about 12 years ago. Updated almost 12 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.

Actions #1

Updated by Koen Deforche about 12 years ago

  • 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

Actions #2

Updated by Koen Deforche almost 12 years ago

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: Atom PDF