NOODB: Property Drilling, your time has come!

It’s time to do the next big thing. I thought it was going to be projections, but alas, it wasn’t meant to be.

The Recent Reviews page shows the author of the review as a link. When you click that link, it’s supposed to show you all of the reviews from that author. I thought I’d knock out that page real quick, but NOODB doesn’t support what I need it to do. Whoops. Now I know what’s next. (Well, strictly speaking I COULD do this by pulling back all of the records and filtering them on the client… but that’s brutal and wouldn’t set a good example for all of those people that don’t read my blog.)

I call this “property drilling” because I am a simple minded fool. I need to read the MovieReview objects and drill down into the author and look at the user name. I need to be able to do this.

from r in MovieReview where r.Author.ScreenName = ‘DvdFriend’

NOODB supports can do r.x but not r.x.y or r.x.y.z; at least not yet.

This will work with collections too. (IE: if any element of the collection matches the criteria, take it). The SQL will have to span one more table, and I’ll have to add a distinct, but it won’t be much more than the non-collection version.

Easy to type, but there’s a lot to implement. I lost a lot of sleep last night thinking about how I would represent that in the query object. The SQL shouldn’t be much of a big deal; the one thing I’ll have to deal with is the possibility of duplicate column names when building the CTE across multiple objects.

Here it is, 10:27pm. On one hand, I’d like to get started on this, but then I’ll probably be up until 2. I think I’ll go play Splinter Cell instead, and leave this for tomorrow night. (That’s a fine idea, as long as I don’t lose sleep mentally coding it again).

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: