Releases: ssi-dk/SCDB
SCDB 0.6.0
Improvements and Fixes
-
delta_export()anddelta_import()functions are added (#213)
These functions facilitate incremental backups and batch migration of a
historical table created withupdate_snapshot().
Seevignette("delta-loading")for usage details. -
Bug fixes in
update_snapshot():- Fixed a bug records were being incorrectly deactivated (#214).
SCDB 0.5.2
SCDB 0.5.1
SCDB 0.5.0
New features
- Added function
create_index()to allow easy creating of an index on a table (#137).
Improvements and Fixes
-
update_snapshot()has been optimized and now runs faster on all the supported backends (#137). -
*_joins()can now takedplyr::join_by()asbyargument when nona_byargument is given (#156). -
SCDBhas been made backwards compatibility to R >= 3.6 (#164). -
nrow()now always returns integers (#163). -
interlace_sqlhas been fully deprecated and removed (#169).
Documentation
- A vignette including benchmarks of
update_snapshot()across various backends is added (#138).
SCDB 0.4.1
Improvements and Fixes
-
Loggernow correctly writes to the "catalog" field on backends that support it (#149). -
get_schema()now correctly returns the temporary schema on PostgreSQL backends (#139). -
get_tables()now returns catalog on DuckDB backends (#145). -
Deprecated
check_fromargument no longer used indbplyrcalls (#136).
Testing
- Improved tests for
get_tables()(#145).
SCDB 0.4.0
BREAKING CHANGES:
-
Table identification is now more specific (#93).
Most SCDB functions allow for tables to be specified by a character representation of "[catalog].schema.table".
Before, if no schema was implied in this context, SCDB would attempt to match the table among both permanent and temporary tables.
Now, it will always assume that a lack of schema means the default schema should be used.
This is also the case ifDBI::Id()is used without a schema specification. -
The
show_temporaryargument ofget_tables()is now a simple logical (#93).In addition, schema is always returned in the list of tables (no longer NA for default schema).
-
Tables created with
create_table()will now be temporary or permanent dependent on the default value of
DBI::dbCreateTable()(#93).If you wish to overwrite this, use
...arguments which are passed toDBI::dbCreateTable(). -
The
%notin%operator has been removed from the package (#96). -
The
db_table_idargument increate_table(),get_table(),table_exists()andid()is renamed todb_table
(#115).
Any object coercible byid()can now be passed to these functions. -
The order of arguments in
create_logs_if_missing()has been swapped to match the rest of the package (#96).
Theconnargument is now before thelog_tableargument. -
The arguments of
Loggerhas been updated (#98):-
db_tablestringis replaced with thedb_tableargument.This argument takes any input coercible by
id()instead of only allowing a character string. -
tsis replaced with thetimestampargument to align withupdate_snapshot().
-
-
The order of input arguments to
Loggeris changed (#98). -
The
interlace_sql()function is deprecated in favor of the S3 genericinterlace()(#113).
New features
-
Added support for DuckDB (#121).
-
The S3 method
as.character.Id()is added which convertsDBI::Id()tocharacter(#93). -
A new
id.data.frame()which convertsdata.frametoDBI::Id()(#108).
Useful in combination withget_tables(conn, pattern). -
A new
get_catalog()function is added to give more specific table identification (#99). -
A new clean up function,
defer_db_cleanup(), is added (#89).By passing a
tbl_sqlobject to this function, the corresponding table will be deleted once
the parent function exits. -
A new function,
unique_table_name(), to generate unique table names is added (#89).
This function is heavily inspired by the unexporteddbplyr:::unique_table_name(). -
A logger is introduced
LoggerNull(#98):-
Loggerfacilitates logging to file/console and logging to database. -
LoggerNullis "no-logging" logger that can be used to suppress all logging.
-
-
Added a set of helper functions to prevent race conditions when writing to data bases (#104).
See
lock_table()andunlock_table().
Improvements and Fixes
-
Improvements for
create_table()(#93):-
now writes the table if a remote connection is given. Before, it would only create the
table with corresponding columns. -
can now create temporary tables for Microsoft SQL Server.
-
-
Improved checks on
get_connection()(#83):-
If given,
hostdoes not need to look like an IP address (e.g. "localhost" is not unrealistic). -
A
characterinput forportis allowed if it is a string of digits. -
Now checks if
timezoneandtimezone_outis an IANA time zone.
-
-
digest_to_checksum()has improved performance on Microsoft SQL Server by use of the built-inHashBytesfunction (#97). -
table_exists()now correctly gives ambiguity warning on Microsoft SQL Server and PostgreSQL backends (#80). -
get_tables()now supports temporary tables for Microsoft SQL Server (#93). -
get_schema()has been updated (#107):-
It will now always return a schema (either directly from the object or inferred by
id()). -
A
temporaryargument is added to get the temporary schemas fromDBIConnections.
-
-
id()now includes information of catalog in more cases (#99, #107). -
Fixed dplyr joins failing if
testthatis not installed (#90). -
The footprint of
update_snapshot()is reduced by cleaning up intermediate tables withdefer_db_cleanup()(#89) -
update_snapshot()now attempts to get a lock on the table being updated before updating (#104). -
Logger$log_info()now usesmessage()instead ofcat()to write to console (#98).
The message written is now also returned invisibly.
Testing
v0.3
- Added support for Microsoft SQL Server using ODBC (@marcusmunch, #77).
Minor Improvements and Fixes
-
Implementation of
*_joins improved, now extendingdplyr::*_joins rather than masking them (@marcusmunch, #77). -
Added S3 method for
id.tbl_dbi, returning aDBI::Id()instance matching the table (@marcusmunch, #72).- Calling
idon atbl_dbithus allows to retrieve aschemaeven when not
initially given.
- Calling
-
Fixed
update_snapshot()not working with aDBI::Id()instance asdb_tableargument (@marcusmunch, #72). -
Suppressed recurring messages from dbplyr >= 2.4.0 about table names containing
.. -
Added
show_tempoption toget_tables()to allow retrieving temporary tables.
Other news
- Maintainer changed to Rasmus Skytte Randløv (@RasmusSkytte).
Full Changelog: v0.2.1...v0.3
SCDB 0.2.1
Minor Improvements and Fixes
-
SQLite connections now support schemata similar to other backends (@marcusmunch, #67).
-
The package logo has been slightly altered to have a readable clock (@RasmusSkytte, #49).
-
Added a vignette describing the concept of a slowly changing dimension using examples (@marcusmunch, #53).
-
Added a
Logger$finalizemethod, which removes thelog_filein the DB when not writing to a file (@marcusmunch, #66).
Other news
- Maintainer changed to Marcus Munch Grünewald @marcusmunch (@RasmusSkytte, #59)
v0.2
SCDB 0.2
Breaking changes
-
update_snapshotnow take aLoggerobject through theloggerargument instead oflog_pathandlog_table_idarguments (@marcusmunch, #24) -
Logger\$log_filenamehas been changed toLogger\$log_basenameto reduce ambiguity
New features
-
Package functions are now also tested with
RPostgres::Postgres(), which is
therefore now officially supported (@marcusmunch, #31) -
get_connectionshows a warning if an unsupported backend is used (@marcusmunch, #26) -
Increased flexibility for the
Loggerobject (@marcusmunch, #21 #24)- A
Loggerinstance may now be created with no arguments - Suppress console output with
output_to_console(TRUEby default) - If no
log_pathis set,Loggerdoes not fail before trying to write to a file Logger\$log_realpathgives the full path to log file being written
- A
Minor improvements and fixes
-
schema_existscorrectly detects a schema with no tables (@marcusmunch, #30) -
db_timestampsnow newer callstranslate_sqlwithcon = NULL(@marcusmunch, #37) -
Package description has been updated to not use a footnote on CRAN
Known issues
- As
schema_existson an empty schema tests by creating a new table, this may
cause issues if the user does not have sufficient privileges.
Full Changelog: v0.1...v0.2
v0.1
SCDB 0.1
Features:
- Functions to handle DB connections
- get_connection, close_connection, id
- Functions to interface with DB
- get_tables, table_exists, get_schema, schema_exists
- Functions to create "historical" tables and logs
- create_table, create_logs_if_missing
- Function to maintain "historical" tables
- update_snapshot
- Functions to interface with "historical" tables
- get_table, slice_time, is.historical
- Functions to facilitate faster joins with NAs on SQL backends
- full_join, inner_join, left_join, right_join
- Functions to manipulate tables on SQL backends
- filter_keys, unite.tbl_dbi, interlace_sql
- A logging object to facilitate logging
- Logger
- Function to generate checksums
- digest_to_checksum
- Function to write timestamps to tables on SQL backends
- db_timestamp
- Helper functions
- nrow - DB compliant nrow
- %notin% - negated %in%
Testing:
- Most package functions are tested here
Documentation
- The functions are fully documented