[GSTsqlite] 1.3.0 released

Posted By: nfs42

[GSTsqlite] 1.3.0 released - 11/22/09 00:09

GSTsqlite - the database plugin for 3DGamestudio.

this plugin uses the well known and proven sqlite database framework.

built with sqlite 3.7.0 from july 2010
lite-c header and c-script compatible with >A6.5, A7, A8

New: threaded queries + Booker demo from AUM 72

it is recommended to check the documentation for the used sql syntax on sqlite.org.

Downloads

Manual
Posted By: Cowabanga

Re: [GSTsqlite] 1.2.0 released - 11/22/09 06:40

Thanks, but when I try to run the demo, I get an error: "Empty prototype called in main".
Posted By: Quad

Re: [GSTsqlite] 1.2.0 released - 11/22/09 08:27

dll itself is missing in the archive.
Posted By: nfs42

Re: [GSTsqlite] 1.2.0 released - 11/22/09 15:35

yes, sorry - it's added and uploaded
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/08/10 21:33

wow, this will be great for an online game test im working on.
Posted By: Felixsg

Re: [GSTsqlite] 1.2.0 released - 01/10/10 11:26

The best sql plug in
I don't know why the user
not see
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/17/10 02:30

in your manual, the title for the entry under GSTsqlite_NextRow() is wrong.
Posted By: nfs42

Re: [GSTsqlite] 1.2.0 released - 01/17/10 16:40

yes, also the demo source code (copied from _GetString ;-) >> updated
thanks for your report
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/17/10 16:56

np, althought i am having a little bit of a hard time figuring it out, it is a great contribution.
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/25/10 17:06

well im having an issue. im trying to use databases made by a program called sqlite browser, but I cant load any of them, it crashes when i call the open command.

ok, well unless i use the database that you packaged with the demo, I can't open any file with more than four letters in its name (not including the extension) ... not sure why.
Posted By: nfs42

Re: [GSTsqlite] 1.2.0 released - 01/25/10 21:14

cannot confirm this. please post your code and your database here or on gstools
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/26/10 06:02

I'm not sure but I think I fixed it. was getting some string/string pointer mixups.
Posted By: nfs42

Re: [GSTsqlite] 1.2.0 released - 01/26/10 15:51

if you got problems, found a bug or have any suggestion contact me.
Posted By: lostclimate

Re: [GSTsqlite] 1.2.0 released - 01/26/10 18:42

will do. thanks.
Posted By: Carlos3DGS

Re: [GSTsqlite] 1.2.0 released - 08/08/10 14:26

Im testing your GSTsqlite but I keep getting a crash in one of my functions "read_RESULTS()".

I made a very simple program just for testing and keep getting an error in this line:
"GSTsqlite_GetString(handleQUERY,"Pass",sTEMP);"
Dont know why because there is a similar line above it that seems to work fine.

This is my short script:
Code:
#include <acknex.h>
#include <default.c>
#include "GSTsqlite.h";

STRING* sDDBB = "test.db";
var handleDDBB;
void open_DDBB()
{
	handleDDBB = GSTsqlite_OpenDatabase(sDDBB);
}

STRING* sQUERY = "select * from mytable";
var handleQUERY;
void execute_QUERY()
{
	handleQUERY = GSTsqlite_ExecuteQuery(handleDDBB,sQUERY);
}

STRING* sRESULTS = "";
STRING* sTEMP = "";
void read_RESULTS()
{
	while(!GSTsqlite_EOF(handleQUERY))
	{
		GSTsqlite_GetString(handleQUERY,"Name",sTEMP);
		str_cat(sRESULTS,sTEMP);
		GSTsqlite_GetString(handleQUERY,"Pass",sTEMP);
		str_cat(sRESULTS,sTEMP);
		GSTsqlite_NextRow(handleQUERY);
	}
}


void close_QUERY()
{
	GSTsqlite_CloseQuery(handleQUERY);
}

void close_DDBB()
{
	GSTsqlite_CloseDatabase(handleDDBB);
}

void main ()
{
	open_DDBB();
	execute_QUERY();
	read_RESULTS();
	close_QUERY();
	close_DDBB();
}


For some reason the line above it that reads "Name" column seems to work, but the one that reads "Pass" column does not work.

the table is not empty and was created with a simple:
sqlite3 test.db
create table mytable(Name varchar(10), Pass varchar(10));
insert into mytable values('Carlos','Ale');
insert into mytable values('Alejandra','Car');


and after I did check it with:
select * from mytable
and got the correct results:
Carlos|Ale
Alejandra|Car

Any healp or insight/hints would be greatly appreciated ;D Im going crazy trying to understand why I get that error.

Error E1513
Crash in read_RESULTS : SYS

I think that is an error with a handle, but I dont understand why it works for the line above if they are the same ;_(

The handle becomes invalid between GSTsqlite_GetString(handleQUERY,"Name",sTEMP); and GSTsqlite_GetString(handleQUERY,"Pass",sTEMP); ? why?


EDIT: I tried putting the "Pass" line above the "Name" line and now pass works fine but Name gives the error... Im going crazy, I have no idea why a pointer would become invalid between those 2 lines?
Posted By: nfs42

Re: [GSTsqlite] 1.2.0 released - 08/09/10 19:56

with lite-c you have to pass string constants with _str("Name") and _str("Pass")

try also GSTsqlite_Debug(100); with -diag option
Posted By: Carlos3DGS

Re: [GSTsqlite] 1.2.0 released - 08/10/10 11:36

adding that _str in those two lines solved everything

Thankyou very much!
Posted By: nfs42

[GSTsqlite] 1.3.0 released - 08/25/10 20:30

built with sqlite 3.7.0 from july 2010
lite-c header and c-script compatible with >A6.5, A7, A8

New: threaded queries + Booker demo from AUM 72

Downloads

Manual
Posted By: txesmi

Re: [GSTsqlite] 1.3.0 released - 06/23/15 15:30

Hi,
I am introducing myself into local databases and found this cool tool you shared with us. Thank you very much! It is what I need.

I have been playing for a couple of days and it worked very well. But I realized it does not work for multiple sentences queries. I put an example:

Code:
CREATE TABLE 'tipos' ( 'index' INTEGER PRIMARY KEY AUTOINCREMENT, 'nombre' VARCHAR(32) UNIQUE, 'cantidad' INTEGER ); 
INSERT INTO 'tipos' ( 'nombre', 'cantidad' ) VALUES ( 'Tipo 000', 0 );" );



It simply obviates the second sentence.

In the try to build triggers for my database. It works well for single sentences but crashes when trying to add a new sentence to the automation.

Code:
CREATE TRIGGER 'contador_tipo' AFTER INSERT ON 'objetos'
	BEGIN
		UPDATE 'tipos' SET 'cantidad' = 'tipos'.'cantidad' + 1 WHERE 'tipos'.'index' = NEW.'tipo';
		UPDATE 'tipos2' SET 'cantidad' = 'tipos2'.'cantidad' + 1 WHERE 'tipos2'.'index' = NEW.'tipo';
	END;



I know this addon is getting old but is there any chance to fix it? Thank you anyway. It helps me a lot as it is.

Salud!

PD: tried to create an account on gstools.de forum but the system failed frown
Posted By: nfs42

Re: [GSTsqlite] 1.3.0 released - 07/21/15 18:47

hi txesmi,

sorry for the late response.

sql statements without line feeds work. i will look into this.


PS: that login error was a bug with the new recaptcha plugin. it works now
Posted By: txesmi

Re: [GSTsqlite] 1.3.0 released - 07/22/15 06:57

Hi nsf42,
I think I tried it before, but I have newly written multiple staments in a single line (with no line feeds) and it does not work. It behaves same. frown

Thank you for your time!
Posted By: nfs42

Re: [GSTsqlite] 1.3.0 released - 07/27/15 17:10

oops
multiple lines worked never sick
try 3.8.11 (compiled with sqlite 3.8.11) http://projects.gstools.de/public/gstsqlite/releases

You need
Code:
GSTsqlite_ExecuteSQL(var hDB, STRING* sSQL);


Code:
hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("DELETE TABLE 'tipos';")); // execute a sql-statement
  hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("CREATE TABLE 'tipos' ( 'index' INTEGER PRIMARY KEY AUTOINCREMENT, 'nombre' VARCHAR(32) UNIQUE, 'cantidad' INTEGER );")); // execute a sql-statement
  hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("INSERT INTO 'tipos' ( 'nombre', 'cantidad' ) VALUES ( 'Tipo 001', 1 );")); // execute a sql-statement
  hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("INSERT INTO 'tipos' ( 'nombre', 'cantidad' ) VALUES ( 'Tipo 002', 2 );")); // execute a sql-statement
  hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("INSERT INTO 'tipos' ( 'nombre', 'cantidad' ) VALUES ( 'Tipo 003', 3 );")); // execute a sql-statement
  hndQuery = GSTsqlite_ExecuteSQL(GSTsqlite_hndDB, _str("INSERT INTO 'tipos' ( 'nombre', 'cantidad' ) VALUES ( 'Tipo 004', 4 );")); // execute a sql-statement



ExecuteQuery is suppoesed to query the database for results > single statement.

no other query should be open to execute properly.
Posted By: txesmi

Re: [GSTsqlite] 1.3.0 released - 07/28/15 05:05

Ok, thank you anyway. laugh
Posted By: mayark

Re: [GSTsqlite] 1.3.0 released - 12/17/16 00:48

Could someone share the download of the files and the sample code?

Thank you. The download seems to be broken.
Posted By: mayark

Re: [GSTsqlite] 1.3.0 released - 12/17/16 06:54

Ok I found the gstsqlite.h files and tried to use the below code post
ed in page 2 under post id : #337099

I am getting errors when testing in zorro for some reason. Could someone please help me with the below errors?

It says gstsqllite.h line 33

syntax error.


==

#include <acknex.h>
#include <default.c>
#include "GSTsqlite.h";

STRING* sDDBB = "test.db";
var handleDDBB;
void open_DDBB()
{
handleDDBB = GSTsqlite_OpenDatabase(sDDBB);
}

STRING* sQUERY = "select * from mytable";
var handleQUERY;
void execute_QUERY()
{
handleQUERY = GSTsqlite_ExecuteQuery(handleDDBB,sQUERY);
}

STRING* sRESULTS = "";
STRING* sTEMP = "";
void read_RESULTS()
{
while(!GSTsqlite_EOF(handleQUERY))
{
GSTsqlite_GetString(handleQUERY,"Name",sTEMP);
str_cat(sRESULTS,sTEMP);
GSTsqlite_GetString(handleQUERY,"Pass",sTEMP);
str_cat(sRESULTS,sTEMP);
GSTsqlite_NextRow(handleQUERY);
}
}


void close_QUERY()
{
GSTsqlite_CloseQuery(handleQUERY);
}

void close_DDBB()
{
GSTsqlite_CloseDatabase(handleDDBB);
}

void main ()
{
open_DDBB();
execute_QUERY();
read_RESULTS();
close_QUERY();
close_DDBB();
}
© 2024 lite-C Forums