make_select: Create an SQL SELECT query.

View source: R/factories.R

make_selectR Documentation

Create an SQL SELECT query.

Description

Create a QuerySelectFields instance to select a set of fields. The table name and the list of fields are the only required parameters.

Usage

make_select(
  tabl,
  fields,
  distinct = FALSE,
  limit = NULL,
  where = NULL,
  join = NULL
)

Arguments

tabl

A table name.

fields

A character vector containing field names or a list of ExprField objects.

distinct

If set to TRUE, add the distinct keyword.

limit

Add a limit (integer value) to the number of records returned.

where

Set a StmtWhere instance to add a where clause.

join

Set a StmtJoin instance to add a join clause.

Value

A SelectQuery instance.

Examples

# Here is a simple SELECT query:
make_select("books", fields = c("title", "author"))


sqlq documentation built on Sept. 16, 2025, 9:10 a.m.