Thursday, November 30, 2006

My future (some parts has been removed)

In the near future I'll invest much more time and energies in SQLabs. Now I have to reorganize my ideas and my creativity and try to be much more focused on the personal projects I have set aside some time ago. It is time for me to start developing my project grow.

I am sorry but no comments allowed in this post.

Tuesday, November 21, 2006

Improvements

I just updated SQLite3ProfessionalPlugin to version 2.0.2.
I'll release it in the next days.

This version has two new internal methods, AttachDatabase and DetachDatabase. Using them with an in-memory database for caching 50000 records (with SQLiteRecordSet) now takes 0.7 seconds from about 2.5 seconds of the previous version (the while loop used to insert records in the in-memory db caused the slowdown ). This is about a 400% speed-up and all the code is written in RB.

The trick is to attach the original db to an in-memory database and then for the insert I am doing somethink like:
INSERT INTO rs (...) SELECT * FROM table

As the previous version the SQLiteRecordSet class is released in source code format so you are free to examine or modify it.
I also added a new method (written in RB) SQLCacheSelect (sql as string) as SQLiteRecordSet that simplify a lot all the query that needs to be cached (please note that rs.RecordCount works fine if you use the new SQLCacheSelect method).

Friday, November 17, 2006

Tips for SQLite3ProfessionalPlugin

  • Tips 1

    db.RecordCount in SQLite3ProfessionalPlugin always returns -1 and I discovered that a lot of time in my code I used to check the following condition:

    rs = db.SQLSelect(" ... ")
    if (rs=nil) or (rs.RecordCount = 0) then DoSomething

    this code could be easely replaced by

    if (rs=nil) or (rs.EOF) then DoSomething
    because rs.RecordCount=0 really means rs.EOF=true in this simple test case.
  • Tips 2

    I discovered also that the SQLite3ProfessionalPlugin and DoD example can really be improved (expecially in scrolling time) if I add an index into the in memory database, so, in order to take advantage of the new trick just add the following lines at the end of SQLite3RecordSet.Constructor method:

    // CREATE INDEX
    sql = "CREATE INDEX rs_index ON rs (_SQLABS_INDEX_)"
    mDB.SQLExecute(sql)

    Query time will be slower by about 10/15% but you'll see a big scrolling speed improvement.

Thursday, November 16, 2006

Google AdSense

I decide to start experimenting Google AdSense as you can see on the right panel.I choose to display the following keyworks:

  • sql course
  • learn sql
  • realbasic
  • php

Any advice about new keyworks?
In the next months I'll post more details about how much income I can generate with Google AdSense.

Wednesday, November 15, 2006

SQLite3ProfessionalPlugin and DoD

I extensively use Data-On-Demand ListBox in SQLiteManager and I soon realized that it works perfectly with cached data but not so well with the VirtualMachine or with the sequential RecordSet returned by the new SQLite3ProfessionalPlugin.
One solution could be to use the InstantQuery method build-into the plugin but there are times where this method cannot be used (for example with a count(*) sql where rowid isn't available).

In order to workaround to this issue I created the SQLite3RecordSet class that basically just cache in an in-memory database all the data returned by your sequential query. While I was writing this class I realized that I can do a bit more that just rewrite all the methods of a standard RecordSet, so for example I added the useful MoveTo method.

This solution isn't as fast as an InstantQuery but it works very well with controls like Data-On-Demand or with Einhugur DataGrid.
Here it is a test project.

Monday, November 13, 2006

SQLite3ProfessionalPlugin

SQLite3ProfessionalPlugin 2.0 has been released!

New features in this version are:
- First Universal Binary version
- Added RB database API
- Updated sqlite library to version 3.3.8
- Added the FST1 module in order to support full-text search
- Dropped PEF and RB 5.x support in order to be able to better stay in sync with the latest sqlite library
- Other small fixes and optimizations

It's new reduced price is just $99.
More information available in the official page: SQLite3ProfessionalPlugin

Saturday, November 11, 2006

SQLite2 and SQLite3 plugins

I finished the new SQLite3ProfessionalPlugin and it really rocks, especially on Intel Macs. It has all the features I anticipated in a recent post like full-text search, Universal Binary supports, RB API supports and much more. I plan to release it next Monday or Tuesday (at a reduced price).

In order to be able to create an UB version of SQLiteManager the latest missing piece of the puzzle was to recompile my old SQLitePluginPro plugin for Intel Macs. After some initial attempts I decided to rewrite it in a more modern way, this is why I decided to develop the new SQLite2ProfessionalPlugin (Universal Binary). The new plugin is about 1500 lines of C/C++ code while SQLitePluginPro was about 4000 lines. The new plugin follow the implementation of SQLite3ProfessionalPlugin so nothing is cached in ram and based on my test it is really blazing fast. The new plugin is also a lot easier to maintain and to improve in the future.

I am not sure if I'll release it to end users but if you need sqlite 2 support in you modern RB application drop me a line and I am sure we can reach an agreement (BTW: it isn't a free product).

A new assistant

At SQLabs we have a new assistant:





Say hello to Sanciok...