Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine
Thanks James, And also thanks for the 'confusing' comment. ;) I've been looking through the code and have found a few places where things can be made a little more clear. If we actually push forward with the module, I've also got some ideas for adding some nice functionality to the module as well (see initial post). Diggy James Cox [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... fwiw, i have also meddled with birdstep slightly, by making the namechange from velocis to birdstep. I agree with Dan -- i think it should be pecl'ed, and perhaps not so reliant on the odbc stuff -- that whole extension is just confusing. That said, Dan is the best person to work on with this. -- james -Original Message- From: Diggy Bell [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 3:49 AM To: Dan Kalowsky Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine Thanks Dan, From looking at the module that was in ./ext/odbc, it was created using a somewhat earlier release of the RDM Server/Velocis (circa Velocis v2.x). I had to make a number of changes related to API changes in Birdstep's libraries to support ODBC 3.51. I've also started laying the groundwork to take advantage of scrollable cursors (a painful omission from the current version of RDM Server). Since there doesn't seem to be anyone familiar with Birdstep, I guess I could volunteer to be the 'expert'. In reality, I was the first beta and deployed customer back in '92, and later went to work for the company (then Raima) in '94. I was a Sr. Proj. Lead and Eng. Mgr. for their consulting subsidiary (Vista Development) until late 2000. These days I'm running my own business and use PHP for a variety of needs. But with Birdstep wanting this module, I became interested in being able to give back to the community more directly. Supporters are great, but sometimes someone needs to get in the trenches and I guess I'm silly enough to want to do it. ;) With respect to the changes, I listed the changes that I've already made in the original post, but there are some additional mods that are needed. 1. There is currently no way to ensure that connections are closed properly. If a script doesn't call birdstep_close() the module will leak connection handles and will eventually exhaust available connections on the server. 2. Birdstep's support for LONG VARCHAR columns has some limitations surrounding use of SQLFetch vs. SQLFetchScroll. To meet Birdstep's needs, I am using fixed buffers for these columns in the module. I'm looking at the possibility of using RDM Server's BLOB handling functions (the 'd_' API) to allow for more efficient handling of these columns. 3. There are some significant improvements that could be made to the error handling. The module currently has no access to error information returned from the server. There are also a few places in the code that could be handled a little more gracefully if an error occurs. As for the PECL module, I'll have to do a little more investigation into what would be required. I got started with the standard extension architecture and worked from there. If the change to PECL is straightfoward, I'll go ahead and start looking at getting that done. If you can point at any good reference sources, I'd be most thankful! :-D Diggy - Original Message - From: Dan Kalowsky [EMAIL PROTECTED] To: Diggy Bell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, November 17, 2002 12:42 PM Subject: Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine Hello Diggy, Birdstep was rolled into the ODBC functionality, and has really not seen any support since. I don't believe anyone currently on the PHP staff is really familiar with the way the Birdstep systems work. The reality is though that I don't see many PHP users using Birdstep/Velocis support. This could of course be a chicken/egg problem, where the PHP support is lacking etc etc... What are the changes you're planning to do? If you'd like to make birdstep it's own module, I'd suggest looking at creating it as a PECL module, and working from there. Typically we don't discourage integration with systems/API's, especially if the author is willing to maintain it :) On Sunday, November 17, 2002, at 03:30 PM, Diggy Bell wrote: Hello again, I've not heard anything from anybody regarding my previous post. My first thought is that everyone is caught up in the release activities, but I would appreciate any comments that anyone might be able to offer. Thanks, Diggy Diggy Bell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I have recently
[PHP-DEV] Re: Support for Birdstep RDM Server database engine
Hello again, I've not heard anything from anybody regarding my previous post. My first thought is that everyone is caught up in the release activities, but I would appreciate any comments that anyone might be able to offer. Thanks, Diggy Diggy Bell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I have recently been approached by Birdstep about updating the PHP module to support their database engine for an internal project. In the past (v4.1.2 and earlier IIRC), PHP has provided support for the Birdstep (formerly Velocis) database as part of the distribution. Since v4.1.2 (IIRC) this support has been dropped in the standard source tree. But, I was able to locate the old code under ./ext/odbc and so I have resurrected the module. In the process, I have made a number of modifications and additions to the library to bring it up to date with the latest version of Birdstep's product. My main question is: Is this module something that the community would like to have available again? If so, I am willing to pick up the maintenance duties on the module. I'm a former employee of the company and have access to 'back-door' support when necessary. I've taken a bit of time and put together some notes on the modifications that I have made to this point. These notes are copied below for review. I've also attached the modified source files. (NOTE: I realize these aren't formatted to PHP standards...please let me slide on that one while I'm making more significant changes :-P) If there is interest, I am also considering addiing some enhancements for connection management and error handling. Any thoughts/comments would be appreciated. -- William D. 'Diggy' Bell Principal DB Software Development http://www.dbsoftdev.com /* CUT HERE */ Birdstep PHP Extension Design Specification Date: 11/14/2002 By: William D. 'Diggy' Bell INTRODUCTION The Birdstep PHP Extension allows PHP applications to access the Birdstep RDM Server database engine. REQUIREMENTS 1. Support for LONG VARCHAR columns 2. Positioned fetch operations 3. Support for birdstep_fetch_array() 4. Support for birdstep_num_fields() 5. Support for birdstep_affected_rows() DESIGN CONSIDERATIONS 1. API conflict between SQLFetchScroll and SQLGetData There is a current design limitation in the RDM Server that prevents the use of SQLGetData() with rowsets that have been retrieved using SQLFetchScroll(). This limitation strongly impacts how LONG VARCHAR fields can be handled. Two methods are described below. a. Use SQLFetch() instead of SQLFetchScroll(). The requirement for positioned fetch operations eliminates this option. b. Use a maximum sized buffer for LONG VARCHAR columns In this method, a buffer of a fixed maximum size would be allocated for each LONG VARCHAR column. The column would then be bound using SQLBindCol() to retrieve the data in one operation. Option (b) was chosen because it allows support for SQLFetchScroll(). This can have significant implications on applications that have a large number of LONG VARCHAR columns due to unnecessarily high memory requirements. NOTE: There are additional limitations in the RDM Server engine that have prevented implementation of cursor positioning. SQLFetchScroll will continue to be used for smoothest migration when RDM Server support for cursor positioning is added. INTERNAL DATA STRUCTURES typedef struct VConn { HDBC hdbc; long index; int connected; } VConn; typedef struct { char name[32]; char*value; long vallen; SDWORD valtype; } VResVal; typedef struct Vresult { HSTMThstmt; VConn* conn; long index; VResVal* values; long numcols; int fetched; } Vresult; typedef struct _php_birdstep_globals { long num_links; long max_links; int le_link; int le_result; } php_birdstep_globals; INTERNAL FUNCTIONS PHP_MINIT_FUNCTION(birdstep) PHP_MSHUTDOWN_FUNCTION(birdstep) PHP_RINIT_FUNCTION(birdstep) PHP_RSHUTDOWN_FUNCTION(birdstep) PHP_MINFO_FUNCTION(birdstep) APPLICATION PROGRAMMING INTERFACE birdstep_connect($server, $user, $password) - Parameters: $server - RDM Server name $user - database user name $password - user's password Returns: connection handle Description: This function will connection to the RDM Server identified by $server. The $user and $password must be valid users on the server. birdstep_close($conn) - Parameters: $conn - connection handle to close Returns: TRUE if successful, FALSE if an error occurred. Description: This function will close the specified connection to the RDM Server birdstep_exec($conn, $sql)
Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine
Hello Diggy, Birdstep was rolled into the ODBC functionality, and has really not seen any support since. I don't believe anyone currently on the PHP staff is really familiar with the way the Birdstep systems work. The reality is though that I don't see many PHP users using Birdstep/Velocis support. This could of course be a chicken/egg problem, where the PHP support is lacking etc etc... What are the changes you're planning to do? If you'd like to make birdstep it's own module, I'd suggest looking at creating it as a PECL module, and working from there. Typically we don't discourage integration with systems/API's, especially if the author is willing to maintain it :) On Sunday, November 17, 2002, at 03:30 PM, Diggy Bell wrote: Hello again, I've not heard anything from anybody regarding my previous post. My first thought is that everyone is caught up in the release activities, but I would appreciate any comments that anyone might be able to offer. Thanks, Diggy Diggy Bell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I have recently been approached by Birdstep about updating the PHP module to support their database engine for an internal project. In the past (v4.1.2 and earlier IIRC), PHP has provided support for the Birdstep (formerly Velocis) database as part of the distribution. Since v4.1.2 (IIRC) this support has been dropped in the standard source tree. But, I was able to locate the old code under ./ext/odbc and so I have resurrected the module. In the process, I have made a number of modifications and additions to the library to bring it up to date with the latest version of Birdstep's product. My main question is: Is this module something that the community would like to have available again? If so, I am willing to pick up the maintenance duties on the module. I'm a former employee of the company and have access to 'back-door' support when necessary. I've taken a bit of time and put together some notes on the modifications that I have made to this point. These notes are copied below for review. I've also attached the modified source files. (NOTE: I realize these aren't formatted to PHP standards...please let me slide on that one while I'm making more significant changes :-P) If there is interest, I am also considering addiing some enhancements for connection management and error handling. Any thoughts/comments would be appreciated. -- William D. 'Diggy' Bell Principal DB Software Development http://www.dbsoftdev.com /* CUT HERE */ Birdstep PHP Extension Design Specification Date: 11/14/2002 By: William D. 'Diggy' Bell INTRODUCTION The Birdstep PHP Extension allows PHP applications to access the Birdstep RDM Server database engine. REQUIREMENTS 1. Support for LONG VARCHAR columns 2. Positioned fetch operations 3. Support for birdstep_fetch_array() 4. Support for birdstep_num_fields() 5. Support for birdstep_affected_rows() DESIGN CONSIDERATIONS 1. API conflict between SQLFetchScroll and SQLGetData There is a current design limitation in the RDM Server that prevents the use of SQLGetData() with rowsets that have been retrieved using SQLFetchScroll(). This limitation strongly impacts how LONG VARCHAR fields can be handled. Two methods are described below. a. Use SQLFetch() instead of SQLFetchScroll(). The requirement for positioned fetch operations eliminates this option. b. Use a maximum sized buffer for LONG VARCHAR columns In this method, a buffer of a fixed maximum size would be allocated for each LONG VARCHAR column. The column would then be bound using SQLBindCol() to retrieve the data in one operation. Option (b) was chosen because it allows support for SQLFetchScroll(). This can have significant implications on applications that have a large number of LONG VARCHAR columns due to unnecessarily high memory requirements. NOTE: There are additional limitations in the RDM Server engine that have prevented implementation of cursor positioning. SQLFetchScroll will continue to be used for smoothest migration when RDM Server support for cursor positioning is added. INTERNAL DATA STRUCTURES typedef struct VConn { HDBC hdbc; long index; int connected; } VConn; typedef struct { char name[32]; char*value; long vallen; SDWORD valtype; } VResVal; typedef struct Vresult { HSTMThstmt; VConn* conn; long index; VResVal* values; long numcols; int fetched; } Vresult; typedef struct _php_birdstep_globals { long num_links; long max_links; int le_link; int le_result; } php_birdstep_globals; INTERNAL FUNCTIONS PHP_MINIT_FUNCTION(birdstep) PHP_MSHUTDOWN_FUNCTION(birdstep) PHP_RINIT_FUNCTION(birdstep) PHP_RSHUTDOWN_FUNCTION(birdstep) PHP_MINFO_FUNCTION(birdstep) APPLICATION PROGRAMMING INTERFACE birdstep_connect($server, $user, $password)
Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine
Thanks Dan, From looking at the module that was in ./ext/odbc, it was created using a somewhat earlier release of the RDM Server/Velocis (circa Velocis v2.x). I had to make a number of changes related to API changes in Birdstep's libraries to support ODBC 3.51. I've also started laying the groundwork to take advantage of scrollable cursors (a painful omission from the current version of RDM Server). Since there doesn't seem to be anyone familiar with Birdstep, I guess I could volunteer to be the 'expert'. In reality, I was the first beta and deployed customer back in '92, and later went to work for the company (then Raima) in '94. I was a Sr. Proj. Lead and Eng. Mgr. for their consulting subsidiary (Vista Development) until late 2000. These days I'm running my own business and use PHP for a variety of needs. But with Birdstep wanting this module, I became interested in being able to give back to the community more directly. Supporters are great, but sometimes someone needs to get in the trenches and I guess I'm silly enough to want to do it. ;) With respect to the changes, I listed the changes that I've already made in the original post, but there are some additional mods that are needed. 1. There is currently no way to ensure that connections are closed properly. If a script doesn't call birdstep_close() the module will leak connection handles and will eventually exhaust available connections on the server. 2. Birdstep's support for LONG VARCHAR columns has some limitations surrounding use of SQLFetch vs. SQLFetchScroll. To meet Birdstep's needs, I am using fixed buffers for these columns in the module. I'm looking at the possibility of using RDM Server's BLOB handling functions (the 'd_' API) to allow for more efficient handling of these columns. 3. There are some significant improvements that could be made to the error handling. The module currently has no access to error information returned from the server. There are also a few places in the code that could be handled a little more gracefully if an error occurs. As for the PECL module, I'll have to do a little more investigation into what would be required. I got started with the standard extension architecture and worked from there. If the change to PECL is straightfoward, I'll go ahead and start looking at getting that done. If you can point at any good reference sources, I'd be most thankful! :-D Diggy - Original Message - From: Dan Kalowsky [EMAIL PROTECTED] To: Diggy Bell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, November 17, 2002 12:42 PM Subject: Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine Hello Diggy, Birdstep was rolled into the ODBC functionality, and has really not seen any support since. I don't believe anyone currently on the PHP staff is really familiar with the way the Birdstep systems work. The reality is though that I don't see many PHP users using Birdstep/Velocis support. This could of course be a chicken/egg problem, where the PHP support is lacking etc etc... What are the changes you're planning to do? If you'd like to make birdstep it's own module, I'd suggest looking at creating it as a PECL module, and working from there. Typically we don't discourage integration with systems/API's, especially if the author is willing to maintain it :) On Sunday, November 17, 2002, at 03:30 PM, Diggy Bell wrote: Hello again, I've not heard anything from anybody regarding my previous post. My first thought is that everyone is caught up in the release activities, but I would appreciate any comments that anyone might be able to offer. Thanks, Diggy Diggy Bell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I have recently been approached by Birdstep about updating the PHP module to support their database engine for an internal project. In the past (v4.1.2 and earlier IIRC), PHP has provided support for the Birdstep (formerly Velocis) database as part of the distribution. Since v4.1.2 (IIRC) this support has been dropped in the standard source tree. But, I was able to locate the old code under ./ext/odbc and so I have resurrected the module. In the process, I have made a number of modifications and additions to the library to bring it up to date with the latest version of Birdstep's product. My main question is: Is this module something that the community would like to have available again? If so, I am willing to pick up the maintenance duties on the module. I'm a former employee of the company and have access to 'back-door' support when necessary. I've taken a bit of time and put together some notes on the modifications that I have made to this point. These notes are copied below for review. I've also attached the modified source files. (NOTE: I realize these aren't formatted to PHP standards...please let
RE: [PHP-DEV] Re: Support for Birdstep RDM Server database engine
fwiw, i have also meddled with birdstep slightly, by making the namechange from velocis to birdstep. I agree with Dan -- i think it should be pecl'ed, and perhaps not so reliant on the odbc stuff -- that whole extension is just confusing. That said, Dan is the best person to work on with this. -- james -Original Message- From: Diggy Bell [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 3:49 AM To: Dan Kalowsky Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine Thanks Dan, From looking at the module that was in ./ext/odbc, it was created using a somewhat earlier release of the RDM Server/Velocis (circa Velocis v2.x). I had to make a number of changes related to API changes in Birdstep's libraries to support ODBC 3.51. I've also started laying the groundwork to take advantage of scrollable cursors (a painful omission from the current version of RDM Server). Since there doesn't seem to be anyone familiar with Birdstep, I guess I could volunteer to be the 'expert'. In reality, I was the first beta and deployed customer back in '92, and later went to work for the company (then Raima) in '94. I was a Sr. Proj. Lead and Eng. Mgr. for their consulting subsidiary (Vista Development) until late 2000. These days I'm running my own business and use PHP for a variety of needs. But with Birdstep wanting this module, I became interested in being able to give back to the community more directly. Supporters are great, but sometimes someone needs to get in the trenches and I guess I'm silly enough to want to do it. ;) With respect to the changes, I listed the changes that I've already made in the original post, but there are some additional mods that are needed. 1. There is currently no way to ensure that connections are closed properly. If a script doesn't call birdstep_close() the module will leak connection handles and will eventually exhaust available connections on the server. 2. Birdstep's support for LONG VARCHAR columns has some limitations surrounding use of SQLFetch vs. SQLFetchScroll. To meet Birdstep's needs, I am using fixed buffers for these columns in the module. I'm looking at the possibility of using RDM Server's BLOB handling functions (the 'd_' API) to allow for more efficient handling of these columns. 3. There are some significant improvements that could be made to the error handling. The module currently has no access to error information returned from the server. There are also a few places in the code that could be handled a little more gracefully if an error occurs. As for the PECL module, I'll have to do a little more investigation into what would be required. I got started with the standard extension architecture and worked from there. If the change to PECL is straightfoward, I'll go ahead and start looking at getting that done. If you can point at any good reference sources, I'd be most thankful! :-D Diggy - Original Message - From: Dan Kalowsky [EMAIL PROTECTED] To: Diggy Bell [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, November 17, 2002 12:42 PM Subject: Re: [PHP-DEV] Re: Support for Birdstep RDM Server database engine Hello Diggy, Birdstep was rolled into the ODBC functionality, and has really not seen any support since. I don't believe anyone currently on the PHP staff is really familiar with the way the Birdstep systems work. The reality is though that I don't see many PHP users using Birdstep/Velocis support. This could of course be a chicken/egg problem, where the PHP support is lacking etc etc... What are the changes you're planning to do? If you'd like to make birdstep it's own module, I'd suggest looking at creating it as a PECL module, and working from there. Typically we don't discourage integration with systems/API's, especially if the author is willing to maintain it :) On Sunday, November 17, 2002, at 03:30 PM, Diggy Bell wrote: Hello again, I've not heard anything from anybody regarding my previous post. My first thought is that everyone is caught up in the release activities, but I would appreciate any comments that anyone might be able to offer. Thanks, Diggy Diggy Bell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello All, I have recently been approached by Birdstep about updating the PHP module to support their database engine for an internal project. In the past (v4.1.2 and earlier IIRC), PHP has provided support for the Birdstep (formerly Velocis) database as part of the distribution. Since v4.1.2 (IIRC) this support has been dropped in the standard source tree. But, I was able to locate the old code under ./ext/odbc and so I have resurrected the module. In the process, I have made a number of modifications and a