db.createdb.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <h2>DESCRIPTION</h2>
  2. <em>db.createdb</em> allows the user to create a new empty database
  3. through different drivers. A working database connection needs to be
  4. established, see <em><a href="db.login.html">db.login</a></em>.
  5. <p>
  6. Currently only <a href="grass-sqlite.html">SQLite</a>
  7. and <a href="grass-pg.html">PostgreSQL</a> database drivers are
  8. supported.
  9. <h2>EXAMPLES</h2>
  10. <h3>Create a new SQLite file-based database</h3>
  11. Note that the standard GRASS GIS SQLite database is by default
  12. generated in the user's current mapset. This example shows an
  13. out-of-mapset database file creation:
  14. <div class="code"><pre>
  15. db.createdb driver=sqlite database=/opt/sqlite.db
  16. </pre></div>
  17. <h3>Create a new PostgreSQL database</h3>
  18. Create a new PostgreSQL database (after the PostgreSQL connection got
  19. established through the <em>pg</em> driver):
  20. <div class="code"><pre>
  21. db.createdb driver=pg database=grassdb
  22. </pre></div>
  23. <p>
  24. Create a new PostgreSQL database (after the PostgreSQL connection got
  25. established through the <em>odbc</em> driver):
  26. <div class="code"><pre>
  27. db.createdb driver=odbc database=grassdb
  28. </pre></div>
  29. <h2>TODO</h2>
  30. Support other database drivers, too.
  31. <h2>SEE ALSO</h2>
  32. <em>
  33. <a href="db.columns.html">db.columns</a>,
  34. <a href="db.connect.html">db.connect</a>,
  35. <a href="db.describe.html">db.describe</a>,
  36. <a href="db.drivers.html">db.drivers</a>,
  37. <a href="db.dropdb.html">db.dropdb</a>,
  38. <a href="db.droptable.html">db.droptable</a>,
  39. <a href="db.execute.html">db.execute</a>,
  40. <a href="db.login.html">db.login</a>,
  41. <a href="db.tables.html">db.tables</a>
  42. </em>
  43. <p>
  44. <a href="sql.html">GRASS SQL interface</a>
  45. <h2>AUTHORS</h2>
  46. Radim Blazek, ITC-Irst, Trento, Italy<br>
  47. SQLite and PostgreSQL support by Martin Landa, Czech Technical University in Prague, Czech Republic
  48. <p>
  49. <i>Last changed: $Date$</i>