A couple of suggestions...

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL

A couple of suggestions...

Post by DaveW » Fri 26 Nov 2004 07:57

Forgive me if there are some code standards that are preventing these suggestions from being appropriate but I'll throw them in the arena anyway coz they'd make my life more pleasant...

Firstly, auto generated code (this applies to MySQL and PostgreSQL versions)...

1) If a column name has a lowercase first letter, then the automatically generated code should adhere to TitleCaseMethodNamingConvention...

I'll use a table called person for the sake of argument, with a column called height:

Currently, if you auto-generate code you get PersonRow class with the following methods...

Code: Select all

public void IsheightNull() { ... }
public void SetheightNull() { ... }
... whereas these should most probably rather be:

Code: Select all

public void IsHeightNull() { ... }
public void SetHeightNull() { ... }
Perhaps even the property names (e.g. height) could also use TitleCase, as they are public properties.


And my second suggestions is this...

2) for people who aren't using a DataAdapter, but want to use the command builder to quickly create their PgSqlCommand objects, it would be great if the parameter naming used the column names instead of :p1, :p2, :p3 etc...

So, for a person table with three fields (name, height, weight) the parameters for the auto-generated UpdateCommand could be called "name", "height" and "weight" rather than p1, p2 and p3. Would this feature prevent the DataAdapter from working?



Posts: 140
Joined: Mon 08 Nov 2004 12:07

Post by Yuri » Mon 29 Nov 2004 14:53

Thank you for suggestions.
At the nearest time we don't plan to add formatting for table names and columns
in TitleCaseMethodNamingConvention. To create own names of columns and tables you can use TableMapping(ColumnMapping).
As to your second suggestion, we'll correct generation of names of the parameters.
These improvements will be available with the next version of PostgreSQLDirect. NET
that will be released in the next month.