Connection.findOne

Returns the requested structure or a Nullable null value if no rows are returned

This method queries for the given structure by its primary key. If no primary key can be found, a compile-time error will be generated.

  1. Nullable!T findOne(U id)
    struct Connection
    Nullable!T
    findOne
    (
    T
    U
    )
    (
    U id
    )
  2. Nullable!T findOne(string filter, U vals)

Examples

1 Connection conn; // An established connection
2 struct User
3 {
4 	@serial @PKey int id;
5 	...
6 };
7 
8 auto user = conn.findOne!User(1); // will search by the id attribute

Meta