[GRASS-SVN] r63155 - grass/trunk/scripts/v.db.update
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Nov 26 09:30:53 PST 2014
Author: neteler
Date: 2014-11-26 09:30:53 -0800 (Wed, 26 Nov 2014)
New Revision: 63155
Modified:
grass/trunk/scripts/v.db.update/v.db.update.py
Log:
partially revert r63154
Modified: grass/trunk/scripts/v.db.update/v.db.update.py
===================================================================
--- grass/trunk/scripts/v.db.update/v.db.update.py 2014-11-26 17:28:45 UTC (rev 63154)
+++ grass/trunk/scripts/v.db.update/v.db.update.py 2014-11-26 17:30:53 UTC (rev 63155)
@@ -43,10 +43,6 @@
#%end
#%option G_OPT_DB_WHERE
#%end
-#%option G_OPT_F_INPUT
-#% key: sqliteextra
-#% description: Name of libsqlitefunctions file for extra functions (SQLite backend only)
-#%end
import sys
import os
@@ -59,7 +55,6 @@
value = options['value']
qcolumn = options['qcolumn']
where = options['where']
- sqlitefile = options['sqliteextra']
mapset = grass.gisenv()['MAPSET']
@@ -76,13 +71,6 @@
database = f['database']
driver = f['driver']
- # check for SQLite backend for extra functions
- if sqlitefile and driver != "sqlite":
- grass.fatal(_("Use of libsqlitefunctions only with SQLite backend"))
- if driver == "sqlite" and sqlitefile:
- if not os.access(sqlitefile, os.R_OK):
- grass.fatal(_("File <%s> not found") % sqlitefile)
-
# checking column types
try:
coltype = grass.vector_columns(vector, layer)[column]['type']
@@ -105,12 +93,8 @@
if where:
cmd += " WHERE " + where
- # SQLite: allow for extra functions if provided by user
- if sqlitefile:
- sqliteload = "SELECT load_extension('%s');\n" % sqlitefile
- cmd = sqliteload + cmd + ";\n"
-
grass.verbose("SQL: \"%s\"" % cmd)
+
grass.write_command('db.execute', input = '-', database = database, driver = driver, stdin = cmd)
# write cmd history:
More information about the grass-commit
mailing list