On SQLite

Matts on 2003-07-28T23:19:45

It seems DBD::SQLite is my most popular module now. Everyone at YAPC::Eu that I spoke to was using it for something - whether it be prototyping or really using it in anger for something. And that's fantastic, as for me it was really just an experiment to learn how to write a DBI driver!

And thanks for all the patches and bug reports everyone.

On a similar note, I came across a great tip on the SQLite mailing list today about how to use an index with a LIKE query:

> I have a > > table directry (id integer, name varchar, address varchar) > > and an index on name. I want to access records by name via the > following query: > > select id from directry where name like 'john%'; > > It turns out that my query does not make use of the index on the > field name ( as opposed to the query "...where name ='john doe';" ). > > Do you know if there is any way to make the query lookup the index on > the field name? > SELECT id FROM directory WHERE name>='john' AND name < 'joho' __END__

Hacky, but kinda cool.