You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having an IDbParameter interface, and tweaking IDbCommand.Execute methods' ParamArray handling to accept it, would allow providing named and output parameters inline, without needing to deal with ADODB.Parameter directly.
The interface should expose the ADODB.Parameter object (much like DbConnection exposes the ADODB.Connection object) - this should fit the bill:
'@Interface'@ModuleDescription("An object representing a command parameter.")Option ExplicitPublicPropertyGetParameter()AsADODB.ParameterEndPropertyPublicPropertyGetParameterName()AsStringEndPropertyPublicPropertyGetParameterValue()AsVariantEndPropertyPublicPropertyGetParameterType()AsADODB.DataTypeEnumEndPropertyPublicPropertyGetParameterDirection()AsADODB.ParameterDirectionEnumEndPropertyPublicPropertyGetParameterSize()AsLongPublicPropertyGetIsNamedParameter()AsBooleanEndProperty
Needs a StubDbParameter implementation for unit tests, and the DbParameter class needs to property-inject the properties through a number of factory methods:
Create should take in all dependencies
FromValue should take in a value (and an optional name, direction, and size)
NullValue should take in a data type (and an optional name, direction, and size)
The IsNamedParameter get-only property should return True if a name was supplied. Unit tests should validate that a command doesn't accept mixed named & ordinal parameters.
The text was updated successfully, but these errors were encountered:
Having an
IDbParameter
interface, and tweakingIDbCommand.Execute
methods'ParamArray
handling to accept it, would allow providing named and output parameters inline, without needing to deal withADODB.Parameter
directly.The interface should expose the
ADODB.Parameter
object (much likeDbConnection
exposes theADODB.Connection
object) - this should fit the bill:Needs a
StubDbParameter
implementation for unit tests, and theDbParameter
class needs to property-inject the properties through a number of factory methods:Create
should take in all dependenciesFromValue
should take in a value (and an optional name, direction, and size)NullValue
should take in a data type (and an optional name, direction, and size)The
IsNamedParameter
get-only property should returnTrue
if aname
was supplied. Unit tests should validate that a command doesn't accept mixed named & ordinal parameters.The text was updated successfully, but these errors were encountered: