You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Marten ORM presently allows the create of raw SQL queries for which the whole SQL statement must be provided and whose results are automatically mapped to model instances.
For example:
Article.raw("SELECT * FROM articles WHERE title = ?", "hello")
Article.raw("SELECT * FROM articles WHERE title = :title AND updated_at > :updated_at", title:"hello", updated_at:Time.local)
For cases where it's not needed to specify model field columns directly, it could be interesting to have the ability to filter records by simply providing a raw subquery predicate (eg. title = ?) and the associated parameter(s). When doing so, the resulting query set should allow "chaining" additional filters afterwards if necessary.
The advantage of doing so is that the selection of the actual model field columns is left to Marten's ORM, which simplifies the use of raw SQL predicates and avoid having to specify full SQL statements.
The text was updated successfully, but these errors were encountered:
Description
The Marten ORM presently allows the create of raw SQL queries for which the whole SQL statement must be provided and whose results are automatically mapped to model instances.
For example:
For cases where it's not needed to specify model field columns directly, it could be interesting to have the ability to filter records by simply providing a raw subquery predicate (eg.
title = ?
) and the associated parameter(s). When doing so, the resulting query set should allow "chaining" additional filters afterwards if necessary.For example:
The advantage of doing so is that the selection of the actual model field columns is left to Marten's ORM, which simplifies the use of raw SQL predicates and avoid having to specify full SQL statements.
The text was updated successfully, but these errors were encountered: