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

Connection conn; // An established connection
struct User
{
	@serial @PKey int id;
	...
};

auto user = conn.findOne!User(1); // will search by the id attribute

Meta