[gnome-db] SqlBuilder feedback

Murray Cumming <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <1256511375.31031.13.camel@murrayc-x61>
I've looked at the new GdaSqlBuilder API and I have some thoughts.

Firstly, I think that the IDs are exposed too often. I can see how the
ID could have some use to an application programmer, but it should not
be the main way to use the API.

At the least, this (pseudo-code) is annoying:
  gda_sql_builder_add_field(builder, 
    gda_sql_builder_add_id(builder, 0, "sometable.somefield") );

This would be nicer:
  gda_sql_builder_add_field(builder, "somefield",
"sometable" (optional))
  would be nicer.

In subsequent calls, GdaSqlBuilder would use the same ID automatically.


The current API gets even more long-winded when dealing with values too,
for UPDATE commands:
  gda_sql_builder_add_field(builder, 
    gda_sql_builder_add_id(builder, 0, "sometable.somefield") );
    gda_sql_builder_add_expr(builder, 0, NULL, 123) );

This would be simpler:
  gda_sql_builder_add_field_value(builder, "somefield",
"sometable" (optional), 123);

-- 
[email protected]
www.murrayc.com
www.openismus.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.