Title: | HSCI Research Group Database Utilities |
---|---|
Description: | Database utility functions used by the HSCI research group. |
Authors: | Eetu Mäkelä [aut, cre] |
Maintainer: | Eetu Mäkelä <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2025-03-11 04:46:26 UTC |
Source: | https://github.com/hsci-r/hscidbutil |
dplyr::compute()
that creates Aria tables.Version of dplyr::compute()
that creates Aria tables.
compute_a(sql, name, temporary, overwrite, ...)
compute_a(sql, name, temporary, overwrite, ...)
sql |
the sql to compute |
name |
the name of the table to create (defaults to a new unique table name) |
temporary |
whether to create a temporary table (defaults to TRUE if table name not specified, otherwise needs to be explicitly specified) |
overwrite |
whether to overwrite existing tables (default to TRUE for temporary tables, FALSE otherwise) |
... |
Other arguments passed on to |
a dbplyr tbl referencing the table computed
dplyr::compute()
.ColumnStore version of dplyr::compute()
.
compute_c(sql, name, temporary, overwrite, ...)
compute_c(sql, name, temporary, overwrite, ...)
sql |
the sql to compute |
name |
the name of the table to create (defaults to a new unique table name) |
temporary |
whether to create a temporary table (defaults to TRUE if table name not specified, otherwise needs to be explicitly specified) |
overwrite |
whether to overwrite existing tables (default to TRUE for temporary tables, FALSE otherwise) |
... |
Other arguments passed on to |
a dbplyr tbl referencing the table computed
dplyr::copy_to()
that creates Aria tables and has a better parameter orderVersion of dplyr::copy_to()
that creates Aria tables and has a better parameter order
copy_to_a(df, con, name, temporary, overwrite, ...)
copy_to_a(df, con, name, temporary, overwrite, ...)
df |
the dataframe to copy to the SQL store |
con |
the connection to the SQL store |
name |
the name of the table to create (defaults to a new unique table name) |
temporary |
whether to create a temporary table |
overwrite |
whether to overwrite existing tables (default to TRUE for temporary tables, FALSE otherwise) |
... |
Other arguments passed on to |
a dbplyr tbl referencing the table created
dplyr::copy_to()
that creates ColumnStore tables and has a better parameter orderVersion of dplyr::copy_to()
that creates ColumnStore tables and has a better parameter order
copy_to_c(df, con, name, temporary, overwrite, ...)
copy_to_c(df, con, name, temporary, overwrite, ...)
df |
the dataframe to copy to the SQL store |
con |
the connection to the SQL store |
name |
the name of the table to create (defaults to a new unique table name) |
temporary |
whether to create a temporary table (defaults to TRUE if table name not specified, otherwise needs to be explicitly specified) |
overwrite |
whether to overwrite existing tables (default to TRUE for temporary tables, FALSE otherwise) |
... |
Other arguments passed on to |
a dbplyr tbl referencing the table created
tmp_
in the given schemasDelete all "temporary" tables starting with tmp_
in the given schemas
delete_temporary_tables(con, ...)
delete_temporary_tables(con, ...)
con |
the connection to probe |
... |
the schemas to probe |
Get a database connection as defined by a yaml configuration or environment variables
get_connection( params = here("params.yaml"), secret = here("secret.yaml"), key = "db", bigint = "integer", ... )
get_connection( params = here("params.yaml"), secret = here("secret.yaml"), key = "db", bigint = "integer", ... )
params |
a params.yaml-file that defines some of db_host, db_name and db_user under a given key |
secret |
a secret.yaml-file that defines some of db_host, db_name, db_user and db_pass under a given key |
key |
the key in the yaml file to extract |
bigint |
how should the connection convert bigints |
... |
Other arguments passed on to |
the MariaDB connection object
List schemas in a database
list_schemas(con)
list_schemas(con)
con |
the connection to probe |
a list of the schemas defined in the database
tmp_
in the given schemaList all "temporary" tables starting with tmp_
in the given schema
list_temporary_tables(con, ...)
list_temporary_tables(con, ...)
con |
the connection to probe |
... |
the schemas to probe |
a tibble with TABLE_SCHEMA and TABLE_NAME columns containing information of the temporary tables found.
Register all tables in a schema as dbplyr tables in the given enviroment
register_tables(con, schemas, envir = .GlobalEnv)
register_tables(con, schemas, envir = .GlobalEnv)
con |
the connection to probe |
schemas |
the schemas to probe |
envir |
the environment in which to register the tables |