[GRASS-dev] new v.in.geonames: problems with UTF-8 Unicode text

Glynn Clements glynn at gclements.plus.com
Wed Jul 2 12:57:58 EDT 2008


Markus Neteler wrote:

> > In theory, the driver could scan the entire table and determine the
> > widest element. But that would be slow for large tables, and it could
> > also confuse clients trying to add data to an existing table.
> 
> Right. It would be perfect to have a "bundled" env var like:
> GRASS_SQLITE_TEXTCOL_LENGTH=name,length

IMHO, it would be better to explicitly store metadata in the SQLite
database. E.g.

CREATE TABLE sqlite_column_types ( table TEXT , column TEXT , coltype INT , length INT )

Whenever a table is created, deleted or modified, the driver would
update the sqlite_column_types table with the appropriate data. When
querying the structure of a table (i.e. db__driver_describe_table()),
the driver would read the data from that table.

The main drawback here is that if you create, delete or modify tables
other than through the SQLite driver, the metadata could become
inconsistent.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list