wiki:FDORfc33

FDO RFC 33 - Parameter Binding Direction Enhancement

This page contains an change request (RFC) for the FDO Open Source project. More FDO RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission Date April 9, 2009
Last Modified Aleck Sun Timestamp
AuthorAleck Sun
RFC Statusadopted
Implementation StatusPending
Proposed Milestone3.5.0.0
Assigned PSC guide(s)Greg Boone
Voting HistoryAugust 10, 2009
+1Orest, Traian, Greg, Jackie
+0Jason
-0
-1

Overview

The purpose of this RFC is to enhance the FDO API to improve parameter binding support needed for SQL pass-through.

Motivation

The current FDO API for parameter binding support for FdoISQLCommand is to add parameters through the FdoICommand interface. However, the current parameter value interface does not specify the parameter direction (in/out). To be able to use SQL stored procedures and functions, the ability to specify parameter direction for each of the parameters is necessary. Thus, we will enhance the parameter value interface to specify the direction.

Requirements

In order to support the above item, the FDO API will be updated to add more methods.

Parameter Direction Enumeration

A new enumeration, FdoParameterDirection, will be added to the FDO API for use within FDO Commands that utilize parameters. FdoParameterDirection defines the direction in which the command will utilize the parameter upon execution. Parameter direction values are typically Input, Output, InputOutput and Return, with the default value is typically Input.

/// \brief
/// The FdoParameterDirection enumeration defines the direction in which a
/// Parameter value will be used within the context of an FDO Command. Parameter 
/// Direction values are typically Input, Output, InputOutput and Return. 
/// The default value is FdoParameterDirection_Input.
enum FdoParameterDirection 
{
    FdoParameterDirection_Input,
    FdoParameterDirection_Ouput,
    FdoParameterDirection_InputOutput,
    FdoParameterDirection_Return
};

Parameter Value Interface

The FdoParameterValue class will be updated to add an additional property Direction, which will indicate the direction in which the parameter will be used within the context of command if the parameter direction is applicable for the command. If the command does not support parameter direction, or the parameter direction is fixed as for FDO Select, the direction will be ignored

/// \brief
/// The FdoParameterValue class specifies a value for a particular parameter.
/// Instances of this class are used to specify a value to bind to a parameter
/// when a command is executed.
class FdoParameterValue : public FdoIDisposable
{
public:
...
...
...
    /// \brief
    /// Sets the function direction of the parameter value.
    /// Values can be Input, Output, InputOutput and Return.
    /// The default value for direction property in Input
    /// 
    /// \param value 
    /// Input the direction enumeration value
    /// 
    /// \return
    /// Returns nothing
    /// 
    FDO_API void SetDirection(FdoParameterDirection value);

    /// \brief
    /// Gets the function direction of the the command parameter.
    /// Values can be Input, Output, InputOutput and Return.
    /// 
    /// \return
    /// Returns the direction enumeration value
    /// 
    FDO_API FdoParameterDirection GetDirection();
};

Managed FDO API

The FDO Managed Interfaces will be updated in a similar manner to reflect the proposed changes.

Provider Implementation

SQLite will be enahced to add the additional parameter direction support. Adding support to SQL Server Spatial should also be high on the priority list. However, depending on resourcing, this may not be achievable in FDO 3.5.0. Support for ODBC and MySQL are considered nice to have and will be implemented if resourcing and funding can be obtained.

Test Plan

Existing FDO Core unit tests will be expanded to test the proposed enhancements defined above.

Provider specific unit tests will be added to test the proposed enhancements defined above.

Funding/Resources

Autodesk to provide resources / funding

Last modified 15 years ago Last modified on Aug 17, 2009, 11:36:34 AM
Note: See TracWiki for help on using the wiki.