Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)



Permlink Replies: 4 - Last Post: Sep 2, 2015 8:12 AM Last Post By: Tom Roberts
Tom Roberts

Posts: 102
Registered: 6/21/05
Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 20, 2015 10:27 AM
Suppose I wanted to avoid it but still use TFDQuery etc. for SQLite. I'm familiar with how to write these functions e.g.

void MyFunction(sqlite3_context *ctx,int nargs,sqlite3_value **values)
{
// code here
}

sqlite3_create_function_v2(DB,"MyFunction",-1,SQLITE_UTF8 | SQLITE_DETERMINISTIC,
NULL,&MyFunction,NULL,NULL,NULL);

but what would I put for the DB parameter in sqlite3_create_function_v2 with respect to the usual FireDAC components (TFDConnection etc.) and properties?
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 1, 2015 10:39 PM   in response to: Tom Roberts in response to: Tom Roberts
but what would I put for the DB parameter in sqlite3_create_function_v2 with respect to the usual FireDAC components (TFDConnection etc.) and properties?

http://docwiki.embarcadero.com/Libraries/XE8/en/FireDAC.Comp.Client.TFDCustomConnection.CliObj

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Tom Roberts

Posts: 102
Registered: 6/21/05
Re: Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 2, 2015 7:36 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
but what would I put for the DB parameter in sqlite3_create_function_v2 with respect to the usual FireDAC components (TFDConnection etc.) and properties?

http://docwiki.embarcadero.com/Libraries/XE8/en/FireDAC.Comp.Client.TFDCustomConnection.CliObj

--
With best regards,
Dmitry Arefiev / FireDAC Architect

Thanks Dimitry. I had actually worked that out some time ago after reading the 'Using SQLite low-level API' section of this web page (http://docwiki.embarcadero.com/RADStudio/XE8/en/Using_SQLite_with_FireDAC) however I was unable to find a way of including the sqlite3. c file in my project so I could use the sqlite3_create_function_v2 function etc. Including sqlite3.c in the project led to all sorts of double declaration and ambiguity compiler messages.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 2, 2015 7:54 AM   in response to: Tom Roberts in response to: Tom Roberts
however I was unable to find a way of including the sqlite3. c file in my project so I could use the sqlite3_create_function_v2 function etc.

Something like that:
((TSQliteDatabase *) FDConnection1->CliObj)->Lib->Fsqlite3_create_function_v2(.......)

For details see FireDAC.Phys.SQLiteWrapper.pas and TSQLiteHandle, TSQLiteDatabase, TSQLiteLib classes.

--
With best regards,
Dmitry Arefiev / FireDAC Architect
Tom Roberts

Posts: 102
Registered: 6/21/05
Re: Overhead of using FDSQLiteFunction (FireDAC SQLite function wrapper)
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 2, 2015 8:12 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry Arefiev wrote:
however I was unable to find a way of including the sqlite3. c file in my project so I could use the sqlite3_create_function_v2 function etc.

Something like that:
((TSQliteDatabase *) FDConnection1->CliObj)->Lib->Fsqlite3_create_function_v2(.......)

For details see FireDAC.Phys.SQLiteWrapper.pas and TSQLiteHandle, TSQLiteDatabase, TSQLiteLib classes.

--
With best regards,
Dmitry Arefiev / FireDAC Architect

Thanks Dimitry. Will take a look later.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02