<div dir="ltr">Hi,<div class="gmail_extra">i found a simple solution with the help of Markus Metz:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><span style="font-size:12.8px">db.connect driver=sqlite database='$GISDBASE/$LOCATION_</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">NAME/$MAPSET/vector/$MAP/</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">sqlite.db'</span><br></div><div class="gmail_extra"><span style="font-size:12.8px"><br></span></div><div class="gmail_extra"><span style="font-size:12.8px">This will set the database connection for all vector maps in a mapset, hence it should be run directly after mapset creation.</span></div><div class="gmail_extra"><br><div class="gmail_quote">2016-09-09 23:40 GMT+02:00 Blumentrath, Stefan <span dir="ltr"><<a href="mailto:Stefan.Blumentrath@nina.no" target="_blank">Stefan.Blumentrath@nina.no</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">





<div lang="NO-BOK">
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Hei Sören,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">I ran into this recently too, with lots of “Busy SQLite” warnings, when I tried to modify two or more vector maps in parallel.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">So the work you are planning to do would be very much appreciated.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">However, in order to not break existing modules like v.db.join, queries across SQLite DBs would have to be supported.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Here the “attach” keyword might be a starting point for required additions to e.g. v.db.join:
<a href="http://sqlite.org/lang_attach.html" target="_blank">http://sqlite.org/lang_attach.<wbr>html</a></span></p></div></div></blockquote><div><br></div><div>The simple solution that works for me will not work with modules that require a single database to store all vector tables. Hence, all the modules that do not work with dbf databases may also not work with vector map specific sqlite databases.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="NO-BOK"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">It is probably also necessary to think about how (or more precise where) tables are supposed to be handled which are not
 linked to a vector map... Will all non-map tables be saved in their own SQLite DB file?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u></span></p></div></div></blockquote><div> </div><div>I have no clue since i don't have these requirements.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="NO-BOK"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Do you plan to store tables linked to additional layers in the same SQLite file as the vector map?</span></p></div></div></blockquote><div><br></div><div>Nope. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="NO-BOK"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">How would modules like db.tables or db.copy behave? What happens if you connect the attribute table of map a (or just
 table a) to map b?</span></p></div></div></blockquote><div><br></div><div>I see no problem with db.tables and db.copy since all db.* commands have database options to specify the path to the required sqlite database. Connecting a table from map a to map b will not work with the simple solution.</div><div><br></div><div>IMHO the simple db.connect solution should provide all the functionality that i need at the moment, which are parallel vector map processing and mapset merging. </div><div><br></div><div>Best regards</div><div>Soeren</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="NO-BOK"><div><p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Just some thoughts ...<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Cheers<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)">Stefan<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:calibri,sans-serif"> grass-dev [mailto:<a href="mailto:grass-dev-bounces@lists.osgeo.org" target="_blank">grass-dev-bounces@<wbr>lists.osgeo.org</a>]
<b>On Behalf Of </b>Sören Gebbert<br>
<b>Sent:</b> 9. september 2016 23:07<br>
<b>To:</b> GRASS developers list <<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a>><br>
<b>Subject:</b> [GRASS-dev] Separate sqlite database files for vector maps<u></u><u></u></span></p><div><div class="gmail-h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Dear devs,<u></u><u></u></p>
<div>
<p class="MsoNormal">i would like to implement sqlite database support as separated file for each vector map. Similar to the dbf approach but with sqlite. Other databases are no option in my case. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The reasons for this approach are the following:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">* The temporal vector algebra would hugely benefit from separated sqlite vector map files, since it can compute in parallel, no race condition or serial processing of database requests is required<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">* Vector maps can easily be moved between locations with full database content, no data loss. Simply the vector map directory must be archived<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">* Merging of mapsets is much easier, since the vector map sqlite databases don't need to be merged, only copied<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This approach would be implemented in addition to all other existing approaches. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">However, i don't know were to start with this, any hints or suggestions?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Soeren<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div></div>