Permalink
Browse files

sqlite: improve the error when no key_field is set and the primary ke…

…y cannot be autodetected
  • Loading branch information...
1 parent 8cfb40a commit 9b5189abf04e3af8b3e3f914e3a70ae314ace3d0 Dane Springmeyer committed Sep 14, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 plugins/input/sqlite/sqlite_datasource.cpp
@@ -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());
}
}

0 comments on commit 9b5189a

Please sign in to comment.