Change::SQL::Repo
Inherits Reference < Object
Generic interface for querying a repository.
For now this is implemented directly with Postgres as a backing adapter, but extracting an adapter system should be fairly simple.
Constructors
Instance methods
Return all existing records of queryable that match the provided
query, or just all records if no query is given.
Delete the record of queryable with the primary key that matches
the given id value.
Get the record of queryable whose primary key matches the given id
value. If no record matches the query, nil is returned instead.
Attempt to save a record of T to the repository. The insertion is
only attempted if the changeset is currently valid.
Return a single record of queryable that matches the provided query,
or the first result of the query if no query is given.
If multiple records are returned by the query, the first is selected. If no record matches, returns nil.
Attempt to update a record of T in the repository. The update is only
attempted if the changeset is currently valid, and the instance of the
changeset has a primary key value set.