• Welcome, Guest. Please login.
 
May 26, 2019, 12:33:55 pm

News:

Welcome to the SQLitening support forums!


SQLite3 client/server 0003

Started by Paul Squires, September 23, 2007, 05:25:09 pm

Previous topic - Next topic

Paul Squires

I just uploaded the newest version of the files (we'll call these Ver 0003) 

http://www.planetsquires.com/files/sqlite_test_0003.zip  (This file is about 3.8 megs)

2007-09-23   ver 0003

  • Added sql3_Close so that a database can be closed during the session. Note that databases are closed automatically whenever a session is destroyed or the application ends and the sql3Client DLL unloads.


  • Changed sql3_Select to add a 4th parameter which defines the cache size in terms of the number of rows that should be transferred from the server to the client when needed. No longer are all rows sent over the connection at one time. The client application can now request to receive the rows from the server on an as needed basis.


  • Changed all sql3_rs* recordset functions now require that the session handle (e.g. hSession) be passed as the first parameter of their function call.


  • Added sql3_fix as a new function that the programmer can call. This function simple double escapes any embedded single quote characters in a string. This helps prevent errors when a single quote is present in a string that forms part of an SQL statement.


  • Changed sql3_use to include a 3rd parameter call nUseMode. That parameter specifically controls how the database will be treated (i.e. whether it will be opened for use on the local client computer or if it will be opened for use on the server computer). The values can be %SQL3_LOCAL, %SQL3_REMOTE. If neither of these values is specified then a %ERR_BADUSEMODE error is returned.


Michael Sydenham

Hi Paul

Thanks for making this available. I have some questions.. are you planning to make the sql3server program a service at some stage, ideally with a tray icon to start/stop the service? Also are you planning to support working with UTF-16 encoded databases as well?

Another thing that might be good for the future is encrypted communication between client & server.

Thanks. I'm looking forward to testing this some more!

Paul Squires

September 24, 2007, 08:34:44 am #2 Last Edit: September 24, 2007, 10:59:21 am by TechSupport
Quote from: Michael Sydenham on September 24, 2007, 04:51:24 am
Thanks for making this available.

You are very welcome.  :)

Quoteare you planning to make the sql3server program a service at some stage, ideally with a tray icon to start/stop the service?

Yes. Definitely.

QuoteAlso are you planning to support working with UTF-16 encoded databases as well?

Yes, I certainly want the product to be able to work with UTF-16.

QuoteAnother thing that might be good for the future is encrypted communication between client & server.

That should be very easy to do. I already have the encryption flag built into the transmission - I just don't have the actual encryption implemented. Not sure which algorithm that I will use. I have zlib compression built in and working. Encryption and hash checking is the next logical step.

Quote
Thanks. I'm looking forward to testing this some more!

No problem at all. Just remember that this is still a pretty young project so many of the more advanced goodies will come in time. I need to make sure that the core of the program works well before bombarding the project with many more features. Having said that, the core of the project is working very well at this point.

:)

mikedoty

sql3_Select
Is there a default value for getting all rows?

Paul Squires

Quote from: mikedoty on September 25, 2007, 01:48:42 pm
sql3_Select
Is there a default value for getting all rows?

Does it really matter? You can use sql3_rsRowCount to get the number of rows. The rows are returned as needed so if you don't use any of the sql3_rsGet* functions then the rows stay on the server.

In what situation would you need all of the rows returned immediately?

mikedoty

September 25, 2007, 04:02:45 pm #5 Last Edit: September 25, 2007, 04:37:38 pm by mikedoty
Transactions are now working.

The default of SQL seems to return all.
Just thought it might be  expected if anything less than 1 was passed.
That is a great addition.
Everything might be wanted to avoid multiple calls, but it makes sense
to see how many rows there are before attempting to get it all.

SELECT * FROM parts 

Michael Sydenham

Hi Paul

Basic testing looks good!

I wondered about this point.

If sql3_connect fails (e.g. due to no server running - error code 57), I noticed that a following call to sql3_Use (for the #SQL3_REMOTE case) will return 0. I guess this function probably ought to not be called, but I just followed the general example. I would have thought sql3_Use ought to have returned an error too (something similar to unable to use due to no valid connection).

It probably would be good to have a list of all the error codes (like 57) etc for the next version. Also it'd be good to see an example of using rsServer & rsLastRow.

I'm hanging out for the service version of server, and unicode (UTF-16) support.

Thanks again for all your efforts.

Cheers

Michael.

Paul Squires

I have to admit that the error checking is lacking at this point. Up to this point a lot of my effort was just to get the thing working correctly. I will start fine tuning the code to return more error codes based on the existing conditions.

Michael Sydenham

Yeah I can understand - it's not a big deal of course - it's much more important to work on the major functionality.

I just wanted to mention that particular example before I forgot.


Michael Sydenham

I was referring to error codes that I think are unique to Paul's app, e.g. err 57 I mentioned before. I think this kind of error code is independent of the sqlite code.

Paul Squires

Error 57 is a "Device I/O error" that PowerBASIC reports when it can not establish the TCP connection.


Michael Sydenham

September 28, 2007, 09:32:16 pm #12 Last Edit: September 28, 2007, 09:38:07 pm by Michael Sydenham
Eventually it would be good to get a list of these relevant codes later, since I'm not using PowerBASIC for testing.