Skip to content

sql_install.packages creates external package library for R packages #66

Open

Description

Hi, I'm checking which packages are already installed (SQL Server 2019) and the related library path using a specific connection string

connection <- connectionInfo( server = "server\\instance", database = "anyDB")

for the SQL server/instance. The default library path is C:\Program Files\Microsoft SQL Server\MSSQL15.MHPROD01\R_SERVICES\library .

sql_installed.packages(connectionString = connection, fields=c("Package", "LibPath", "Attributes", "Scope"))

When running this function to install an arbitrary package (for example "tidyverse" or any other)

sql_install.packages(connectionString = connection, pkgs = "tidyverse", verbose = TRUE, scope = "PUBLIC")

then a new external library path F:\Program Files\Microsoft SQL Server\MSSQL15.MHPROD01\MSSQL\ExternalLibraries\5\1\1\tidyverse\R is created.

Now, when running again

sql_installed.packages(connectionString = connection, fields=c("Package", "LibPath", "Attributes", "Scope"))

I can't find the previously installed new package.

Why is that? And how can I appropriately install new packages using sqlmlutils.

Activity

  1. ghost changed the title [-]sql_install.packages creates external package library[/-] [+]sql_install.packages creates external package library for R packages[/+] on May 5, 2020
  2. JonathanZhu11 commented on Jul 15, 2020

    @JonathanZhu11
    Contributor

    You are doing it correctly - can you paste the output of the second sql_installed.packages call here? I cannot repro your issue on my machine. You should see something like this in the "scope" column:

    ...
    rstudioapi "0" "PUBLIC"
    rvest "0" "PUBLIC"
    scales "0" "PUBLIC"
    selectr "0" "PUBLIC"
    sys "0" "PUBLIC"
    tibble "0" "PUBLIC"
    tidyr "0" "PUBLIC"
    tidyselect "0" "PUBLIC"
    tidyverse "1" "PUBLIC"
    tinytex "0" "PUBLIC"
    utf8 "0" "PUBLIC"
    viridisLite "0" "PUBLIC"
    whisker "0" "PUBLIC"
    withr "0" "PUBLIC"
    xml2 "0" "PUBLIC"
    ape NA "SYSTEM"
    assertthat NA "SYSTEM"
    base NA "SYSTEM"
    BH NA "SYSTEM"
    bit NA "SYSTEM"
    bit64 NA "SYSTEM"
    blob NA "SYSTEM"
    ...

    The public packages are the new ones that you just installed, whereas system packages are the ones that were on the machine already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions