Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2015-05

SqlDB + SQLite3 - CreateDB() call

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Does SqlDB+SQLite3 support creating a SQLite database via the TSQLConnection.CreateDB() call? I tested with FPC 2.6.4 and it doesn't seem to work.

More specifically, TIBConnection has CreateDB() implemented, but TSQLite3Connection doesn't.

Is this implemented in the upcoming FPC 3.0 or in 3.1.1 (trunk)?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/
Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
Hi, Does SqlDB+SQLite3 support creating a SQLite database via the TSQLConnection.CreateDB() call? I tested with FPC 2.6.4 and it doesn't seem to work. More specifically, TIBConnection has CreateDB() implemented, but TSQLite3Connection doesn't. Is this implemented in the upcoming FPC 3.0 or in 3.1.1 (trunk)?

Open creates the database if it doesn't exist yet.

Patches to implement a 'CreateDB' welcome, though.

We probably should introduce some extra properties to control the default behaviour. the sql_open call has a variant which has some flags.

Michael.

LacaK
to Michael Van Canneyt

Dňa 18.5.2015 o 11:33 Michael Van Canneyt napísal(a):

Show quoted text 18 lines
On Mon, 18 May 2015, Graeme Geldenhuys wrote: > Hi, > > Does SqlDB+SQLite3 support creating a SQLite database via the > TSQLConnection.CreateDB() call? I tested with FPC 2.6.4 and it doesn't > seem to work. > > More specifically, TIBConnection has CreateDB() implemented, but > TSQLite3Connection doesn't. > > Is this implemented in the upcoming FPC 3.0 or in 3.1.1 (trunk)? Open creates the database if it doesn't exist yet. Patches to implement a 'CreateDB' welcome, though.

I have commited CreateDB/DropDB methods for TSQLite3Connection now (rev. 30884-30885).
I did basic tests ... seems works, but I will be glad if somebody will test it also.
-Laco.

Graeme Geldenhuys
to LacaK
LacaK wrote
I have commited CreateDB/DropDB methods for TSQLite3Connection now (rev. 30884-30885). I did basic tests ... seems works, but I will be glad if somebody will test it also.

Awesome. Many thanks. I'll grab the latest code tonight.

As for testing. Last night I created a SqlDB+SQLite3 test suite 200+ unit tests for SQLite3 support as part of tiOPF's test suite, which now runs roughly 1900 tests every 3 hours. This normally puts database components quite nicely through their paces. In the past I have found many bugs in 3rd party db components with these tests.

In the mean time I created a work-around for the Creating and Dropping of SQLite databases - as per Michael's email. Tonight I'll adapt it with your code, but still keep FPC 2.6.4 compatibility.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/