Database Plugin Version

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Database Plugin Version

Post by Guimauve »

Hello everyone,

The command for Database are little bit limited specially with SQLite. Furthermore when I read something like this :
After ADD COLUMN has been run on a database, that database will not be readable by SQLite version 3.1.3 and earlier.
Source : http://www.sqlite.org/lang_altertable.html

And I don't know the version used by PureBasic in background, I feel little bit nervous. So it is possible to add a command to return the Database Plugin Version as string or at least indicate in the UseSQLiteDatabase() help page the version of SQLite used by the plugin. I think this can be a very useful information.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
User avatar
Kiffi
Addict
Addict
Posts: 1487
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: Database Plugin Version

Post by Kiffi »

Guimauve wrote:So it is possible to add a command to return the Database Plugin Version as string

Code: Select all

UseSQLiteDatabase()

Procedure.s GetSQLiteVersion()
  OpenDatabase(0, ":memory:", "", "", #PB_Database_SQLite)
  DatabaseQuery(0, "Select sqlite_version()")
  NextDatabaseRow(0)
  ProcedureReturn GetDatabaseString(0,0)
EndProcedure

Debug GetSQLiteVersion()
Greetings ... Kiffi
Hygge
User avatar
Guimauve
Enthusiast
Enthusiast
Posts: 742
Joined: Wed Oct 22, 2003 2:51 am
Location: Canada

Re: Database Plugin Version

Post by Guimauve »

Hello,

@Kiffi : Thanks for the code snippet it will be useful.

I have found the information here : http://www.purebasic.fr/english/viewtop ... 7&p=381341

A native command to do this can be a great addition.

Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,

While you guys were
busy arguing about the
glass of water, I DRANK IT !

Sincerely,
the Opportunist
Post Reply