SubSonic Developers: haacked

Login name:
haacked
Total Commits:
12 (0.2%)
Lines of Code:
235 (0.1%)
Most Recent Commit:
2007-05-28 20:11

Activity by Clock Time

Activity by Hour of Day for haacked

Activity by Day of Week for haacked

Activity in Directories

Directory Changes Lines of Code Lines per Change
Totals 12 (100.0%) 235 (100.0%) 19.5
SubSonic/Sql Tools/ 5 (41.7%) 192 (81.7%) 38.4
SubSonic.Tests/ 2 (16.7%) 29 (12.3%) 14.5
SubSonic/ActiveRecord/ 1 (8.3%) 7 (3.0%) 7.0
SubSonic/DataProviders/ 1 (8.3%) 3 (1.3%) 3.0
SubSonic/ 2 (16.7%) 3 (1.3%) 1.5
SubSonic/CodeGeneration/Templates/ 1 (8.3%) 1 (0.4%) 1.0

Activity of haacked

Most Recent Commits

haacked 2007-05-28 20:11 Rev.: 68

IMPROVED: Now it is possible to get the @RETURN_VALUE from a stored procedure.

Sample Usage:

StoredProcedure proc = StoredProcedures.ProcName();
proc.Command.AddReturnParameter();
proc.Execute();
int returnValue = (int)proc.OutputParameters[proc.OutputParameters.Count - 1];

NOTE: For now, you have to explicitly add a return parameter to the command until we know whether all the major databases support this concept. We don't want to automatically add that return value if it is SQL Server specific.

(Also added a unit test for this and cleaned up a bit of related code)

43 lines of code changed in 4 files:

  • SubSonic: Enums.cs (-7)
  • SubSonic/CodeGeneration/Templates: CS_SPTemplate.aspx (+1 -1)
  • SubSonic/DataProviders: SqlDataProvider.cs (+3 -3)
  • SubSonic/Sql Tools: QueryCommand.cs (+39 -34)
haacked 2007-05-28 04:09 Rev.: 66

Changed the StoredProcedure.Execute() method to return an int - the number of rows affected based on whatever the underlying provider returns.

7 lines of code changed in 1 file:

  • SubSonic/ActiveRecord: StoredProcedure.cs (+7 -2)
haacked 2007-05-23 01:51 Rev.: 39

Updated the unit test to demonstrate the strongly typed access to table names and columns.

1 lines of code changed in 1 file:

  • SubSonic.Tests: QueryTest.cs (+1 -1)
haacked 2007-05-23 01:23 Rev.: 38

Implemented a preliminary version of the Constraint based syntax for building queries based on the work done in NUnit: http://nunit.com/index.php?p=constraintModel&r=2.4

Here's an example of the new syntax in action:

new Query("Products").WHERE("ProductID", Is.LessThan(5)).ExecuteReader();

The point of this is it is a bit more readable than:

new Query("Products").WHERE("ProductID", Comparison.LessThan, 5).ExecuteReader();

and provides us more type safety and intellisense thaN:

new Query("Products").WHERE("ProductID < 5").ExecuteReader();

Especially given that "5" is probably going to be a parameter. We don't have to resort to string concatenation.

I'd like to add the following, but I need a deeper understanding of the current system of building queries before I do so:

new Query("Products").WHERE("ProductID", Is.In(5,6,7,8,9)).ExecuteReader();

184 lines of code changed in 6 files:

  • SubSonic.Tests: QueryTest.cs (+28 -20)
  • SubSonic: SubSonic.csproj (+3)
  • SubSonic/Sql Tools: GenericConstraint.cs (new 35), IConstraint.cs (new 19), Is.cs (new 92), Query.cs (+7 -1)
Generated by StatSVN 0.4.1