Plugin Developer DiscussionDiscussion for FogBugz Plugin developers |
||
I created a plugin table with a text column using the IPluginDatabase interface. FogBugz creates text columns as ntext types in SQL Server 2005. I then try to use that column in the where clause of a query using the generic database access functions. The problem is that the ntext type in SQL Server only supports the following functions:
DATALENGTH READTEXT SET TEXTSIZE SUBSTRING UPDATETEXT TEXTPTR WRITETEXT TEXTVALID so I can't do something like "WHERE myColumn = 'abcd'" in my where clause. Unfortunately, FogBugz is parsing the query string and won't let me use any of the above functions. Thus it appears that it's basically impossible to do anything with a FogBugz plugin text column in SqlServer 2005 other than retrieve it. What am I missing?
Yes, currently that is the case. We restrict the functions that can be called for two reasons:
1) Security - we have to use a whitelist here because there are too many ways to do damage otherwise 2) Cross-platform support - we currently restrict plugins to only those functions that are identical across all supported databases (MySQL, MSSQL, Access/Jet) Eventually we want to add a query rewriter that will convert, for example, DATALENGTH to CHARACTER_LENGTH in MySQL. We just haven't gotten to it yet.
Thanks David. I originally wanted to do an attribute table that holds name/value pairs. I suppose I could just use integer constants for my attribute names but that's obviously not ideal. Using an integer constant is still more preferable than adding a fixed column for each possible attribute out of a very broad set.
Would that be added with CTable.addVarcharColumn? I didn't see that previously. I'll give it a try.
Thanks, Brian
Doh! I also missed the fact that a CPluginKeyValueTable interface already exists. Don't you just hate that feeling you get when you realize how much time you've wasted reinventing the wheel?
|
Powered by FogBugz