X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FManual%2FCookbook.pod;h=c84df814b71dc0d910916e61470b1f28954418a3;hb=48580715af3072905f2c71dc27e7f70f21a11338;hp=7fa60d8bf74ea88a3afeb506cb98c228c9d8eeb9;hpb=7d8f64b992d1de9fd3eef9f1d5729ca74153922f;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 7fa60d8..c84df81 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -141,7 +141,7 @@ Next, you can execute your complex query using bind parameters like this: ); ... and you'll get back a perfect L (except, of course, -that you cannot modify the rows it contains, ie. cannot call L, +that you cannot modify the rows it contains, e.g. cannot call L, L, ... on it). Note that you cannot have bind parameters unless is_virtual is set to true. @@ -201,7 +201,7 @@ to access the returned value: # SELECT name name, LENGTH( name ) # FROM artist -Note that the C attribute B with the sql +Note that the C attribute B with the SQL syntax C< SELECT foo AS bar > (see the documentation in L). You can control the C part of the generated SQL via the C<-as> field attribute as follows: @@ -329,7 +329,7 @@ You can write subqueries relatively easily in DBIC. artist_id => { 'IN' => $inside_rs->get_column('id')->as_query }, }); -The usual operators ( =, !=, IN, NOT IN, etc) are supported. +The usual operators ( =, !=, IN, NOT IN, etc.) are supported. B: You have to explicitly use '=' when doing an equality comparison. The following will B work: @@ -411,7 +411,7 @@ Then call your new method in your code: Using SQL functions on the left hand side of a comparison is generally not a good idea since it requires a scan of the entire table. (Unless your RDBMS -supports indexes on expressions - including return values of functions -, and +supports indexes on expressions - including return values of functions - and you create an index on the return value of the function in question.) However, it can be accomplished with C when necessary. @@ -1621,10 +1621,10 @@ B Add the L schema component to your Schema class. This will add a new table to your database called C which will keep track of which version is installed -and warn if the user trys to run a newer schema version than the +and warn if the user tries to run a newer schema version than the database thinks it has. -Alternatively, you can send the conversion sql scripts to your +Alternatively, you can send the conversion SQL scripts to your customers as above. =head2 Setting quoting for the generated SQL @@ -1706,7 +1706,7 @@ methods: } ); -In conditions (eg. C<\%cond> in the L family of +In conditions (e.g. C<\%cond> in the L family of methods) you cannot directly use array references (since this is interpreted as a list of values to be Ced), but you can use the following syntax to force passing them as bind values: