home recent topics recent posts search faq  

Huagati Systems Support Forum



register | lost password   open id sign in with Twitter
Messages in this topic - RSS

Home » Huagati DBML/EDMX Tools Support » New features wishlist forum » User-defined functions in AutoGeneratedColumnRules

What new feature(s) would you like to see in the add-in? Post your suggestions here.
12/5/2009 4:48:17 PM

neaflo
neaflo
Posts: 12
Hi,

I'd like Linq-to-SQL to provide support for user-defined functions in Auto Generated Column Rules dialog box.

If the functions specified in Auto Generated Column Rules dialog box are built-in functions (like getutcdate()), Linq-to-SQL does indeed set the property [Auto Generated Value] to True; but it doesn't work if I'm using user-defined functions. For example even if the column is defined in the database as "user_id datetime default (ldut.current_user_id())", the [Auto Generated Value] property is not set to True for [user_id] column. This would be really helpful for me ...

Furthermore, [Auto Generated Value] property itself is important but equally important is to be able to set at the same time the [Auto Sync] and [Read Only] properties too. Without this, only setting the [Auto Generated Value] property looks like half-job done - I still need to go and change manually the properties of many fields. A very common example where this is needed is "audit" columns.
create table ldut.test_view(
data varchar(100) not null,
-- Audit
registered_on datetime default (getutcdate()) not null,
registered_by datetime default (ldut.current_user_id())
updated_on datetime default (ldut.default_updated_on())
);
I need a way to specify that all columns named [registered_on] (or all columns with default constraints 'function1()') have a certain sets of properties set (e.g. the next properties:
[Auto Generated Column]=True,
[Auto-Sync]=OnInsert,
[Read Only]=true
... and all columns named [updated_on] (or all columns with default constraints 'function2()') have the next properties:
[Auto Generated Column]=True,
[Auto-Sync]=OnUpdate,
[Read Only]=true


I think you have to think seriously about implementing a way of define a "template" which specifies the rules for changing the columns properties. What I think of is something like: on one side you should have the filters to select a table/column (e.g. by name, by type, by default constraints, regex, combinations of [table name, column name, type]), and on the other side the set of properties to apply to each column resulting from the filter (e.g. [Auto Generated Column]=True, [Auto-Sync]=OnUpdate, [Read Only]=true).

If you succeed to implement such generic way, you will automatically resolve my aforementioned request for support for user-defined functions in Auto Generated Column Rules dialog box, and Change UpdateCheck settings will also be covered by this. Still on the plus side, I think this way provides a more visible/readable method to the end-user (programmers) than editing multiple dialogs boxes to achieve the same behaviour.

This method is way more extensible and maintainable than adding small features on request. If you keep on adding small features (like the new Change UpdateCheck settings in 1.82), the user interface gets very unfriendly and probably the project unmaintainable.

Thanks,
Florin Neamtu
edited by neaflo on 12/11/2009
edited by neaflo on 12/11/2009
edited by neaflo on 12/11/2009
edited by neaflo on 12/11/2009

0 permalink

Home » Huagati DBML/EDMX Tools Support » New features wishlist forum » User-defined functions in AutoGeneratedColumnRules





Powered by Jitbit Forum 7.1.0.0 © 2006-2011 Jitbit Software