wxDatabase - A couple of thoughts

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
Post Reply
iwbnwif
Super wx Problem Solver
Super wx Problem Solver
Posts: 282
Joined: Tue Mar 19, 2013 8:52 pm

wxDatabase - A couple of thoughts

Post by iwbnwif »

It is good to see the new examples coming along in wxDatabase.

The pity for me is that I use Firebird and that has been dropped since the days of wxDatabaseLayer.

I would quite like to have a go at adding Firebird back in, but I would want to use IBPP rather than directly using the (horrible!) Interbase C API. In effect the wxFirebirdDatabase would be a thinish wrapper around IBPP. Later I might also look at the Firebird 3 OO API.

Of course this would mean including IBPP within the wxDatabase project, are there any thoughts or concerns about this?

Also I appreciate it is a rather big (and possibly wholly unuseful) change, but I was wondering if it might be worth considering using wxAny in the resultset, in fact a resultset could derive from wxVector<wxVector<wxAny> >.

The reason is that I rather like range based for's :wink: and it would then be possible to do something like:

Code: Select all

  wxDatabaseResultSet resultSet;

  pDatabase->RunQueryWithResults ("SELECT * FROM Names;", resultSet);
  
  for (wxDatabaseRow row : resultSet)
  {
    people.push_back ( myPerson (
    	row.Field("ID").As<int>(), // ID
    	row.Field("NAME").As<wxString>(), // name
    	));
  }
I appreciate that there are a number of problems with this approach, but just wanted to throw it out there ...
wxWidgets 3.1.2, MinGW64 8.1.0, g++ 8.1.0, Ubuntu 19.04, Windows 10, CodeLite + wxCrafter
Some people, when confronted with a GUI problem, think "I know, I'll use Eclipse RCP". Now they have two problems.
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2408
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: wxDatabase - A couple of thoughts

Post by evstevemd »

Thanks for your kind words.
wxDB comes from DatabaseLayer which was basically written for 2.8 and misses much of the goodies of 3.x
My current task is making sure every supported backend builds fine and is at least usable.
I will appreciate if you log your suggestions for using new data structures as Git issues so that when I start updating them I will not miss that.

I will appreciate more testing of the library and help from community as am not that much expert ;)
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply