[GRASS-dev] [GRASS GIS] #3601: db.connect: default answers depend on current DB settings

GRASS GIS trac at osgeo.org
Mon Jul 2 09:23:19 PDT 2018


#3601: db.connect: default answers depend on current DB settings
----------------------------------+-------------------------
 Reporter:  mmetz                 |      Owner:  grass-dev@…
     Type:  defect                |     Status:  new
 Priority:  normal                |  Milestone:  7.4.2
Component:  Database              |    Version:  svn-trunk
 Keywords:  database, connection  |        CPU:  All
 Platform:  All                   |
----------------------------------+-------------------------
 The default answers depend on current DB connection settings.

 Using GRASS defaults:
 {{{
 $ db.connect --help
 [...]
 Parameters:
     driver   Name of database driver
              options: dbf,ogr,pg,sqlite
              default: sqlite
   database   Name of database
              default: $GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
     schema   Database schema
      group   Default group of database users to which select privilege is
 granted
 }}}

 Now modify the default DB connection for the current mapset:
 {{{
 db.connect driver=pg database=mydb schema=grass_schema group=grass_group
 }}}

 New default answers:

 {{{
 $ db.connect --help
 [...]
 Parameters:
     driver   Name of database driver
              options: dbf,ogr,pg,sqlite
              default: pg              <-- !!!
   database   Name of database
              default: mydb            <-- !!!
     schema   Database schema
              default: grass_schema    <-- !!!
      group   Default group of database users to which select privilege is
 granted
              default: grass_group     <-- !!!
 }}}

 Consequently, resetting to GRASS default does not work:

 {{{
 $ db.connect -d
 Default driver / database set to:
 driver: sqlite
 database: /media/storage/GRASSsample_data/nc_spm_08/user1/sqlite/sqlite.db
 }}}

 followed by
 {{{
 $ db.connect -g
 driver=sqlite
 database=$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db
 schema=grass_schema    <-- !!!
 group=grass_group      <-- !!!
 }}}

 The confusion probably arises because there are two different default
 settings: the default settings as defined for the current mapset, and the
 GRASS default settings.

  * the default answers for `db.connect` should always be the GRASS
 defaults
  * resetting to GRASS default connection settings with `db.connect -d`
 must work

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3601>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list