As described in GitHub issue #50 the current implementation of BatchFactTable cannot insert rows containing NULL values if usemultirow=True (the default is False). This PR adds the function getsqlfriendlystr() which converts values to strings that can be used in an SQL expression. It currently converts None to "NULL", encapsulates strings in single quotes, escapes all single quotes in strings by doubling them, and converts the remaining values to strings using str(). The PR also replaces BatchFactTable's internal value to string conversation logic with a call to getsqlfriendlystr().
As described in GitHub issue #50 the current implementation of
BatchFactTable
cannot insert rows containingNULL
values ifusemultirow=True
(the default isFalse
). This PR adds the functiongetsqlfriendlystr()
which converts values to strings that can be used in an SQL expression. It currently convertsNone
to"NULL"
, encapsulates strings in single quotes, escapes all single quotes in strings by doubling them, and converts the remaining values to strings usingstr()
. The PR also replacesBatchFactTable
's internal value to string conversation logic with a call togetsqlfriendlystr()
.