Minor update to handle multi-statement SQL queries when running on MySQL and databricks. No other changes to functions or use.
- uid & pwd arguments in
sql_server$new()depreciated and replaced withuid_varandpwd_varrespectively. These arguments take the name of the environmental variable that holds the related value, as opposed to the values themselves. This means that the R6 object created bysql_server$new()does not then store these credentials itself once created. Code therefore needs changing fromsql_server$new(uid = SQLRtools::get_env_var("MY_PASSWORD")tosql_server$new(uid = "MY_PASSWORD")
- Added connection for databricks to run both locally/on posit connect and in databricks. See README for connection details.
- Added
replace_db_table()method. This will upload a table and replace and existing table with the same name, but will do it in stages to avoid a situation where an error results in the existing table being dropped and the new table not being created (resulting in no table in the database). - Add
catalogs()method. Equivalent ofdatabases(), lists all the catalogs in databricks connection. - Added
schemas()method. List all the schemas in a catalog in databricks. - Added
rename_table()method. Renames a given table.
Minor fix to connecting to database via DSN to include the database in the
connection. This should fix the issue of method table_exists not working
correctly in Linux.
Minor update adding in option to connect to server via a Data Source Name (DSN)
in the initiation of the sql_server class object.
Minor update adding in option to remove encryption in the initiation of the
sql_server class object.
Initial complete package containing:
- R6 class object
sql_serverfor connecting with SQL servers containing methods for interacting with the server, such as running queries, getting meta data and uploading data. get_env_var()to easily implement keyring to store credentials and sensitive information.
Note all methods in sql_server are stable other than the meta_data()
method.