sqlite: improve the error when no key_field is set and the primary key cannot be autodetected

This commit is contained in:
Dane Springmeyer 2012-09-14 16:10:51 -07:00
parent 8cfb40ae2f
commit 9b5189abf0

View file

@ -339,10 +339,12 @@ void sqlite_datasource::bind() const
else
{
std::ostringstream s;
s << "Sqlite Plugin: key_field is empty for "
<< geometry_field_
<< " and "
<< geometry_table_;
s << "Sqlite Plugin: could not generate spatial index"
<< " for table '" << geometry_table_ << "'"
<< " as no primary key can be detected."
<< " You should either declare an INTEGER PRIMARY KEY"
<< " or set the 'key_field' option to force a"
<< " given field to be used as the primary key";
throw datasource_exception(s.str());
}
}