wxDBWrapper development in progress

Do you like to promote your wxWidgets based application or component!? Post it here and let's see what the critics have to say. Also, if you found that ONE wx component the world needs to know about, put it here for future reference.
jpmorfin
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jun 24, 2005 6:53 am
Location: Plats - Ard
Contact:

wxDBWrapper development in progress

Post by jpmorfin » Fri Jun 24, 2005 7:53 am

Hi everybody,

I just want to announce wxDBWrapper :D

The purpose of these files is to encapsulate SQL database connection.
Projects written with wxDBWrapper use only wxDBWDatabase and
wxDBWResultSet interface. This way, the project can switch from one
database engine to another without the need to rewrite database
accesses.

And it's under GNU GPL 2.

Here is a sample to use it :

Code: Select all


#include "wxDBWConfig.h"

void yourfunc()
{
	wxString strTmp;
	
	// create a sqlite3 database (could be another database engine)
	wxDBWDatabase *db = new wxDBWsqlite3(_(""), 0, _("test.sq3"), _(""), _(""));

	if(db->Connect())
	{
		// create table and data
		db->Execute(_("create table test (a, b, c)"));
		db->Execute(_("insert into test values('abc', 'def', 10)"));
		db->Execute(_("insert into test values('ghi', 'jkl', 8.25)"));

		// query database
		wxDBWResultSet *rs = db->Query("select * from test");
		if(rs)
		{
			for(int c=0; c<rs->GetColumnNumber(); c++)
			{
				strTmp = rs->GetColumnName(c);	// get column headers
				/*
					work with strTmp
				*/
			}
			while(rs->Fetch())
			{
				for(int c=0; c<rs->GetColumnNumber(); c++)
				{
					strTmp = rs->GetString(c);	// get a field
					/*
						work with strTmp
					*/
				}
			}
			delete rs;
		}
		else
		{
			strTmp = db->GetErrorText();
		}
		delete db;
	}
	else
	{
		strTmp = db->GetErrorText();
	}
}

Project homepage : https://gna.org/projects/wxdbwrapper

You will find a snapshot here of wxDBWrapper or access to subversion repository at :
svn co svn://svn.gna.org/svn/wxdbwrapper/trunk wxdbwrapper
or
svn co http://svn.gna.org/svn/wxdbwrapper/trunk wxdbwrapper

API documentation at :
http://home.gna.org/wxdbwrapper/annotated.html

Actually, sqlite 2.8x and sqlite 3.x wrappers are available.
I'm currently writting MySQL wrapper...

If you want to contribute, do not hesitate :wink:
Jean-Pierre

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Fri Jun 24, 2005 8:13 am

oh great, thanks for this I think its high time I had an integrated MySQL framework :P

good job so far :D

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX » Fri Jun 24, 2005 8:24 am

lowjoel wrote:oh great, thanks for this I think its high time I had an integrated MySQL framework :P
Hmmm... AFAIK you can use MySQL with pure wxWidgets already.
http://www.wxwidgets.org/manuals/2.6.1/ ... rview.html

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Re: wxDBWrapper development in progress

Post by ABX » Fri Jun 24, 2005 8:36 am

jpmorfin wrote:I just want to announce wxDBWrapper :D
Thanks, but I cannot find clear explanation why somebody should use wxDBWrapper instead of own wxWidgets wxDB access. I'm sure there is some explanation about it which I do not find myself because I do not use wxDB but it would be great to know.
jpmorfin wrote:And it's under GNU GPL 2.
Hmm, is that advantage? I remember there are some limitations regarding mixing wxWidgets licence and GPL licence in one package. Have you heard about that? IIRC in short it was something like:

GPL code + wx code = GPL code

IOW users of your wxDBWrapper are forced to always release under GPL licence which perhaps limits number of your possible users. Why not to use wxWidgets licence or MIT licence?
jpmorfin wrote:Project homepage : https://gna.org/projects/wxdbwrapper
http is enough :)

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

jpmorfin
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jun 24, 2005 6:53 am
Location: Plats - Ard
Contact:

Post by jpmorfin » Fri Jun 24, 2005 8:45 am

That's right ABX, but you need to install ODBC driver and sometime it is not easy to package a software (easy to install) with a such driver :cry:

So wxDBWrapper simplifies this.

Also, wxDBWrapper permits to use SQLite which has no ODBC driver :wink:
Jean-Pierre

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX » Fri Jun 24, 2005 8:50 am

jpmorfin wrote:That's right ABX, but you need to install ODBC driver and sometime it is not easy to package a software (easy to install) with a such driver :cry:

So wxDBWrapper simplifies this.

Also, wxDBWrapper permits to use SQLite which has no ODBC driver :wink:
Oh, I see, thanks. That should definietly be written very early on project homepage.

BTW, one of the early things you probably could add is wxDBWrapper working on top of wxDB itself so all existing work could be reused if ODBC driver is available for the user.

What do you think about licence issues I mentioned?

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

jpmorfin
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jun 24, 2005 6:53 am
Location: Plats - Ard
Contact:

Post by jpmorfin » Fri Jun 24, 2005 9:01 am

About license, I think you are right !

A different license would be less restrictive... I will examine that.
I hope a different license will not conflict database engine license ?? That's why I had chosen GNU GPL 2.

Encapsulate wxDB seems also to be a good idea :)

Thanks ABX
Jean-Pierre

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Fri Jun 24, 2005 9:20 am

when ppl MySQL (which ur working on now) most of us will use GPL because the commercial license simply is rather expensive. So releasing the api under api shouldnt be much of a problem. but true might as well release it under the wx license to be less restrictive :D

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX » Fri Jun 24, 2005 9:51 am

lowjoel wrote:when ppl MySQL (which ur working on now)
(This is my great day in talking to you :), please do not think I'm rude, not at all, but...) Could you please use "better" english. Reading such statements is really hard when somebody is not native english speaker and in fact learned english mainly through computer. Which "ur" of http://www.acronymfinder.com/af-query.asp?Acronym=ur do you mean?
lowjoel wrote:most of us will use GPL because the commercial license simply is rather expensive.
But MySQL is not the only database supported in wxDBWraper. Would you like to limit users of other databases just because of that?
lowjoel wrote:So releasing the api under api shouldnt be much of a problem.
I do not understand you here. What do you mean by "releasing api under api" ?
lowjoel wrote:but true might as well release it under the wx license to be less restrictive :D
Definietly :)

ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Fri Jun 24, 2005 9:57 am

ur lol isnt an acronym its used to mean "your"... lol sorry bout that
and ermreleasing under api under the api lol is a typo lol thanks for pointing it out i was trying to say "releasing the api under gpl isnt much of a problem"

and yes i love unrestrictive licenses. but hey, who doesnt?

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post by Ryan Norton » Fri Jun 24, 2005 10:07 am

ABX wrote:But MySQL is not the only database supported in wxDBWraper. Would you like to limit users of other databases just because of that?
What ABX is saying is that one of the common misconceptions you see with libraries using the GPL is that they think they have to be GPL themselves, when in fact they can be a seperate license and only fall under the GPL when the USE the other software explicitly.
[Mostly retired moderator, still check in to clean up some stuff]

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Sat Jun 25, 2005 9:13 pm

What ABX is saying is that one of the common misconceptions you see with libraries using the GPL is that they think they have to be GPL themselves, when in fact they can be a seperate license and only fall under the GPL when the USE the other software explicitly.
Sorry to jump in, but I suppose I've always misunderstood the GPL then.

I thought that if you used something that was GPL in your project, then your project had to also be GPL (sort of a "poison pill"). Are you saying that's not the case?

I suppose I don't know what you mean by "USE the other software explicitly". Does that mean link to the code as a library or add the code to your own source or something else entirely?

-Tony
Everybody's got something to hide except for me and my monkey.

User avatar
Ryan Norton
Moderator
Moderator
Posts: 1319
Joined: Mon Aug 30, 2004 6:01 pm

Post by Ryan Norton » Sat Jun 25, 2005 9:47 pm

tbreina wrote:
What ABX is saying is that one of the common misconceptions you see with libraries using the GPL is that they think they have to be GPL themselves, when in fact they can be a seperate license and only fall under the GPL when the USE the other software explicitly.
Sorry to jump in, but I suppose I've always misunderstood the GPL then.

I thought that if you used something that was GPL in your project, then your project had to also be GPL (sort of a "poison pill"). Are you saying that's not the case?

I suppose I don't know what you mean by "USE the other software explicitly". Does that mean link to the code as a library or add the code to your own source or something else entirely?

-Tony
As long as you modulize your project, then as long as the user of your project does not use the GPL module then the user is free from the GPL license (but not you, of course).

Its pretty tricky, however.
Last edited by Ryan Norton on Sat Jun 25, 2005 9:49 pm, edited 1 time in total.
[Mostly retired moderator, still check in to clean up some stuff]

alexcoppo
Knows some wx things
Knows some wx things
Posts: 37
Joined: Mon Sep 06, 2004 8:56 am
Location: Italy
Contact:

Post by alexcoppo » Sat Jun 25, 2005 9:49 pm

Everything then even remotely is connected to GPL must be GPL, the license is very clear, so if you write something GPL, it is useless in a business environment.

I consult for living and neither me nor my clients touch anything GPL, even with a long pole (sorry, but I have to pay bills and ideals are not accepted in bank)

Bye

jpmorfin
In need of some credit
In need of some credit
Posts: 7
Joined: Fri Jun 24, 2005 6:53 am
Location: Plats - Ard
Contact:

wxDBWrapper development in progress

Post by jpmorfin » Sun Jun 26, 2005 9:57 am

I'm sorry, but all things said above do not make idea clear :shock:

If I put GNU GPL on wxDBWrapper, I can link it with all database libraries, but it become not useful for wxWidgets community :cry:

It I use wxWidgets license, I'm not sure to link wxDBWrapper with many database libraries :evil:

For information, wxDBWrapper use dynamic libraries (not static link with db lib). I don't know if it's different for license ?

Please, I need to be advised. which license I must use to respect database license constraint and be useful to wxWidgets commercial and non commercial projects ?

Thanks
Jean-Pierre

Post Reply