Help with C externals
pete at mollysrevenge.com
Thu Mar 8 13:05:42 EST 2012
The callbacks that Paul mentions in his reply is one thing - would be great
to be able to display some sort of progress messages during a lengthy db
operation. But seems like that might be a problem according to Paul.
I guess I've come across several niggling issues in the last few months.
The latest one I found is that revDatabaseColumnNames took around 1.5
seconds to retrieve the column names for one table. I'd been chasing my
tail trying to find the cause of slow performance thinking it was something
to do with datagrids or slow sqlite performance, but turns out to be LC.
Using the equivalent PRAGMA to get the column names took hardly any
During the same exercise, I create a cursor with a "SELECT rowid FROM
<table>" statement. Right after that, I issue a revDatabaseColumnNamed
call for rowid and get an error that the column doesn't exist. I found
from calling revDatabaseColumnNames that the cursor has used the primary
key column of the table instead of rowid. Arguably, that shouldn;t be a
problem but I I select rowid, then rowid is what should be in the cursor.
I can get round it by using revDatabaseColumnNumbered.
If you followed the recent thread on putting empty into integer column in
sqlite, you'll know that when you get the data back out agin, it comes back
as zero, not empty. Similar to the rpevious example - you should get back
whatever you put in. I should add that QCC folks have recognised this as a
bug and plan to fix it.
On a performance front, there's been a recent thread regarding how much
faster SQLiteManager is than the LC equivalent calls. Turns out a lot of
that was because of a neat technique used by SQLiteManager but there's
still a performance issue. Issuing "SELECT rowid FROM <table>" in LC takes
about 5 times longer than it does in SQLIteManager for the same table.
I'll admit that the numbers are small but for tables with large enough
number of rows, that's a significant amount of time.
There's a number of useful SQLite externals out there. These are usually
funcations that you can include in SELECT statements or expressions.
SQLite provides a function to load external libraries but it only works if
that functionality is enabled when the database is opened. LC doesn't
provide a way to make that happen and there is no PRAGMA way to do it.
There's more but this is already too long! I'll finish by saying that most
of the stuff I'm writing is in the nature of general purpose tools for
SQLite db administrators and developers so I'm probably using LC calls that
wouldn;t be used by the majority of people who develop a standard app using
a database with a known structure.
On Wed, Mar 7, 2012 at 10:27 PM, Monte Goulding <monte at sweattechnologies.com
> Hmm... what are the issues you are finding?
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
Molly's Revenge <http://www.mollysrevenge.com>
More information about the Use-livecode