GLBasic forum

Codesnippets => Inline / 3rd party => Topic started by: trucidare on 2008-May-30

Title: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-May-30
Hi Folks,

i made a Library for easy Database Access in GLB. Based on SQLite3.
Please PN me for a Registration-Number. Its for free - i want only see how many people use this Lib.
The Demo Version ( DBInit(0) ) can open only 5 Databases.

trucidare

New Commands since Initial-Release:


DBRawCommand(Database,"SQL-String")
DBSearch(Database,"Table","Field for Search","What you want to have - Return","Searchstring")
DBGetTimestamp()
DBMakeRealDate$(Timestamp)
DBMakeRealTime$(Timestamp)


[attachment deleted by admin]
Title: Re: [Release] tDB - Database for Everyone
Post by: Kitty Hello on 2008-Jun-02
Very helpful, thanks a lot.
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-02
 :nw: I owe you one !!! YAHOO !!!!
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-12
Sent you a msg some days ago... can you send me the reg number ? Thank you. 

btw one question...max. of 15 tables, for the registered version ? is that right ?
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-12
no 15 Databases similar open. YOu can put (integert) value of Tables in one Database.
I send you the code yesterday. Now have fun :)
Title: Re: [Release] tDB - Database for Everyone
Post by: Kitty Hello on 2008-Jun-19
Is there a way of getting a (any) database cross-platform?
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-19
is in the work

.so / .dylib and the sdlbasic sqlite3 portation for gp2x. Any other platforms -  i dont know how
Is simple to make the lib. Only compile with cross bin tools and everything works great. Problem now is
the tDB is compiled with GLB.
Title: Re: [Release] tDB - Database for Everyone
Post by: Kitty Hello on 2008-Jun-19
Hm... Why not just linking to libsqlite.o for any platform?
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-19
Give me a little how to, i never linked o files before
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-19
Please don't forget to let us know about any new update on this..
I would like to leave a feedback, because this works so great... it improve my loading time in 500% as my previous version used .ini files for loading data into the program... Thank you Trucidare.
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-19
i work on a network solution and some improvements like raw commands.
please give a feedback on existing functions. what to make better...
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-19
well, we can talk further about it... my expertise is databases anyway (IBM DB2)... thas why my programming skills sucks !! :D
only thing I have missed so far was to send sql commands, but that is what I think you meant by raw commands.

would you be able to write something using odbc ? because with it we could access any database even Oracle or DB2 (they have free version as well)


network solution ?what do you mean ?
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-19
i havent read about a cross plaform odbc driver. so i make it with dll´s mysql lib will come after tDB works fine.

Network solution is a simple server that stores data from client in tDB and send it to clients. for games using webservers for datastorage.
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-19
you can use ODBC (Open database connectivity) to access any database if you had installed its odbc drivers on the machine.
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-19
loved the news about the network solution.
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-21
Done Raw-Command solution. Update soon. Please send me more commands, needed for your projects.
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-23
Sorry for DoublePost:

Update Now!

New Commands:



DBRawCommand(Database,"SQL-String")
DBSearch(Database,"Table","Field for Search","What you want to have - Return","Searchstring")



Have a nice day

// Oops forgotten to Load up the update :/
See First Post

EDIT://

Small Update:

New Commands:

DBGetTimestamp()
DBMakeRealDate$(Timestamp)
DBMakeRealTime$(Timestamp)


its a small Update for Using Timestamps in tDB.

Update in First Post...
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-24
very nice.. I'll download it and test this new functionalities... Let you know later what I think...


thank you Trucidare...
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Jun-25
not all of us works with SQL commands before. i want to make it simply for all.
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jun-30
just playing with the new profiler option :)


FunctionCallsTot.with childsExec.onlyAv.Exe[s/call]
DBInit1---
DBCreateNew10.002000.002000.00200
DBAddTable50.033000.033000.00700
DBAddField360.086000.086000.00200
DBReadRecord100---
DBPut2001.674001.674000.00800
DBGet_Str12880.004000.00400-
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jul-15
Hello trucidare.
how this DBReadrecord works ? Can you do  a little more detailed explanation ?
I really don't get why to do it...
and what about the rawcommand one... can I use it for select ? do I need to use the readrecord as well ? I'm sorry,kinda confused with this...
Title: Re: [Release] tDB - Database for Everyone
Post by: Kitty Hello on 2008-Jul-15
Yes, it would be cool to have a "cleaned up" version of this. With a small tutorial.
And please, please inline "C" code, so we don't need the .dll (and can compile on PocketPC :P )
Title: Re: [Release] tDB - Database for Everyone
Post by: acristo on 2008-Jul-29
Hello trucidare, is there any update coming soon ? :D
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2008-Aug-02
Yes nearly in future but work on gui before. please write if a critical error or must have then i make a fast update.
Title: Re: [Release] tDB - Database for Everyone
Post by: kanonet on 2012-Jan-08
Note to everyone, that comes to this Thread:
Trucidare has released the sourcecode of the last version of tDB here: http://www.glbasic.com/forum/index.php?topic=7563.msg62556#msg62556
Thank you Trucidare!  :good:



----------


I have no C experience and cant get it to work, can someone plz help me? :nw:
I tried it with an without the GLB-Headerpack, in both cases I get the following error:
Code (glbasic) Select
In file included from C:\Users\kanonet\AppData\Local\Temp\glbasic\gpc_temp0.cpp:286:
C:/Users/kanonet/Desktop/tDB/tDB/depends/sqlite3.h:37:67: stdarg.h: No such file or directory
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2012-Jan-08
you need the header package from kitty somewhere in the download or news section of the main site
Title: Re: [Release] tDB - Database for Everyone
Post by: kanonet on 2012-Jan-08
Yeah like i said i tried it with the headerpackage too, same result.
Title: Re: [Release] tDB - Database for Everyone
Post by: kanonet on 2012-Jan-10
I got it working under Windows:
copying the headers wasnt the only thing necessary, i also needed to copy "libsqlite3dll.a" into "GLBasic\Compiler\platform\Win32\Lib". So no problems under Win anymore.
But it only links dynamical, so i still need the .dll to run it. Is there a way to static link it? If i use "libsqlite3.a" instead of "libsqlite3dll.a" it is static linked, but how can i force this behaviour?

But i cant get it to work with Linux (i guess "sglite3dll.a" is only for Win?), i get this error:
Code (glbasic) Select
compile+link:
In file included from /cygdrive/C/Users/kanonet/AppData/Local/Temp/glbasic/gpc_temp0.cpp:296:
/cygdrive/C/Users/kanonet/Desktop/tDB/tDB/depends/sqlite3.h:37:67: stdarg.h: No such file or directory

Can someone help me with this, please?

And finally: the sqlite version used is very outdated, would there be a way to use a newer one? On sqlite.org i cant get a .a file just .c, (how) would it be possible to use this?

Thank you in advance for your help, please keep in mind, that i have no C experience, so please make it clear for me noob.
Title: Re: [Release] tDB - Database for Everyone
Post by: FutureCow on 2012-May-08
Just came across this post as I was looking for a database integration. I assume you either sorted it or no longer need the problem fixed as it's been a few months.
The error though is whinging about a missing header file (stdarg.h) - you'd need that in the right place on your server in order to compile the code.
Title: Re: [Release] tDB - Database for Everyone
Post by: kanonet on 2012-May-08
I havent worked with database since my last post here. But headers werent the problem, it worked under Windows, but not under Linux, like i said before.
Title: Re: [Release] tDB - Database for Everyone
Post by: Kitty Hello on 2012-May-08
best would be to not include stdxxx.h, but make your own tiny header and only include the typed you need. (for small libraries).
Title: Re: [Release] tDB - Database for Everyone
Post by: MrTAToad on 2012-May-09
The GLBasic headers file are rather out of date.  In addition, there are no headers for various platforms either, meaning the routine can't be used on, say, WIZ.

I usually try and remove all #include files and replace various functions with alternatives - for example, fopen gets replaced with open, as the latter is already defined by GLBasic and just needs an extern "C" to be accessible by all platforms...
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2012-Jun-08
oops some days away and someone dig out the tDB Thread :/
there are some issues? Should i make a new, better version?
Title: Re: [Release] tDB - Database for Everyone
Post by: MrTAToad on 2012-Jun-09
Yeah, go on - it'll be a right larf :)
Title: Re: [Release] tDB - Database for Everyone
Post by: FutureCow on 2012-Jun-09
It would be great to have good database integration as part of the language if you have the time to improve it!
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2012-Jun-09
ok i will use some brain to make a new - better one - hmm a object based one?
*use pen & paper*
Title: Re: [Release] tDB - Database for Everyone
Post by: kanonet on 2012-Jun-09
I would like to get a new one too, multiplattform plz (i need it on linux).
OO? - i would like it with as less overhead as possible, i was even thinking about using a mysql server. But i have no DB/SQL knowledge, so if you make it easy to use, i have no problem with some overhead.
Title: Re: [Release] tDB - Database for Everyone
Post by: FutureCow on 2012-Jun-10
Please no OO!!!!!!!!!!!!!!!!!!!
Title: Re: [Release] tDB - Database for Everyone
Post by: trucidare on 2012-Jun-10
the old one was crossplatform too - i released the source and it could be compiled for all platformes that can use sqlite3.
i wanted to try to store types in database - so you can use db.store(myType)

a database type with fake methods which kitty made possible somne Versions before.