freerpc: a dblib rpc debugging tool

frank <[email protected]> Fri, 17 Nov 2017 18:27:54 +0100
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAL3zYbQ+Y+rffR99+Bw84AmW=qAYTakZ+5e7Cau=4C=F1J2+Kg@mail.gmail.com>
Hi all,

I'm a long time user and wanted to contribute someting I recently worked on.

While trying to add RPC support to the php pdo_dblib driver (
https://github.com/php/php-src/pull/2914 ), I put together a simple
debugging tool based on freebcp. It has grown to something of limited use,
but flexible enough to put the dblib rpc api to the test.
It's available here: https://github.com/fandrieu/freetds/commits/freerpc.

In the process I found some bugs and just opened two pull requests to help
improve blob support.

Anyway, would this be valuable addition to the distribution ? would anyone
care to comment on this implementation, notably the use of the dblib API ?

Thanks !
frank.

PS: I didn't write a manpage, but for those interested: the first argument
is the procedure name then parameters values are passed with the "-p value"
option repeated.
Parameters can be configured using those options before -p:
 -t = data type (persists for other params)
 -n = name
 -N = is null, ignore value
 -o = is output
 -f = value is a file with raw data
The usual -S -U etc are used to setup the connection.

Here's some usage examples:
freerpc sp_help -p sp_help -S mssqlf
reerpc sp_executesql -p "select a=@a" -p "@a varchar(max)" -t char -n @a -p
test -S mssql
freerpc sp_executesql -p "set @i=@i+1" -p "@i int out" -t int1 -op 4
freerpc sp_executesql -p "set @b=upper(@a)" -p "@a text, @b text out" -t
text -fp configure -oNfp CONFIGURE -S mssql