diff --git a/packages/fcl-db/tests/database.ini.txt b/packages/fcl-db/tests/database.ini.txt index 3cd4d55c4f..52e57a5de2 100644 --- a/packages/fcl-db/tests/database.ini.txt +++ b/packages/fcl-db/tests/database.ini.txt @@ -79,6 +79,23 @@ user=sysdba password=masterkey hostname=localhost +; Firebird embedded +; Same as Firebird, except we leave the host name blank +; and specify a db without path. +; Make sure your Firebird embedded library files (.dll/.so/.dylib) +; are installed; e.g. on Windows, you can put them in this +; directory. +; Test code will create db if it doesn't exist; you can +; delete an existing db file before the test to start +; fresh. +[firebirdembedded] +connector=sql +connectorparams=interbase +name=fbembedtest.fdb +user=sysdba +password=masterkey +hostname= + ; ODBC database: [odbc] connector=sql diff --git a/packages/fcl-db/tests/sqldbtoolsunit.pas b/packages/fcl-db/tests/sqldbtoolsunit.pas index 9c2e95ef9a..f05bb66d7c 100644 --- a/packages/fcl-db/tests/sqldbtoolsunit.pas +++ b/packages/fcl-db/tests/sqldbtoolsunit.pas @@ -229,6 +229,14 @@ begin UserName := dbuser; Password := dbpassword; HostName := dbhostname; + if (dbhostname='') and (SQLDbType=interbase) then + begin + // Firebird embedded: create database file if it doesn't yet exist + // Note: pagesize parameter has influence on behavior. We're using + // Firebird default here. + if not(fileexists(dbname)) then + FConnection.CreateDB; //Create testdb + end; if length(dbQuoteChars)>1 then begin FieldNameQuoteChars:=dbquotechars;