create_index: Create the indexes on table

View source: R/create_index.R

create_indexR Documentation

Create the indexes on table

Description

Create the indexes on table

Usage

create_index(conn, db_table, columns)

Arguments

conn

(DBIConnection)
A connection to a database.

db_table

(⁠id-like object(1)⁠)
A table specification (coercible by id()).

columns

(character())
The columns that should be unique.

Value

NULL (called for side effects)

Examples


  conn <- get_connection()

  mt <- dplyr::copy_to(conn, dplyr::distinct(mtcars, .data$mpg, .data$cyl), name = "mtcars")
  create_index(conn, mt, c("mpg", "cyl"))

  close_connection(conn)


SCDB documentation built on April 3, 2025, 7:15 p.m.