Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user_manual/introduction/browser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Importing vector layers into databases using Browser panel

QGIS allows you to import vector layers directly into a database from the :guilabel:`Browser` panel.
This provides a simple way to transfer datasets into supported database
formats without using |dbManager| :sup:`DB Manager`.
formats without using |dbManager| :sup:`DB Manager` (see :ref:`dbmanager`).

You can start the import in two ways:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong opinion, can we provide schema in this screenshot?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a screenshot for importing to gpkg; the schema label should have been deactivated also (will be fixed in qgis/QGIS#64089)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/user_manual/plugins/core_plugins/plugins_db_manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,76 @@ Double clicking on an entry will add the string to the SQL window.
to use.


Import Vector Layer
---------------------------

You can import layer or file into your database. Here are the parameters you can set
for the import process:
Comment on lines +114 to +115
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make a reference to this section ?


* :guilabel:`Input`: Select the layer or file to import. Using the dropdown menu,
select from the list of loaded layers in QGIS or click on the
:guilabel:`...` button to select a file from disk.
Check the |checkbox| :guilabel:`Import only selected features` to import only the selected
features of the layer.
* :guilabel:`Output table`: Choose the :guilabel:`Schema` and provide a name for the new table.
* :guilabel:`Options`: Here are some options for the import process:

- |checkbox| :guilabel:`Primary key`: Provide naming for the primary key field.
By default, it is named ``id``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(need to check but) does this not default to gid for PostgreSQL?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id on my end

- |checkbox| :guilabel:`Geometry column`: Provide naming for the geometry column.
By default, it is named ``geom``.
- |checkbox| :guilabel:`Source SRID`: Define the SRID for the geometry column.
By default, it uses the layer's CRS.
- |checkbox| :guilabel:`Target SRID`: Define the target SRID to reproject the geometries
during the import process. By default, it uses the layer's CRS.
- |checkbox| :guilabel:`Encoding`: Define the encoding of the source data. By default, it uses ``Automatic``.
It is QGIS's automatic detection mode that attempts to guess the file's character encoding based on available metadata or system locale.
- |checkbox| :guilabel:`Replace destination table (if exists)`: If a table with the same name already exists in the selected schema,
it will be replaced.
- |checkbox| :guilabel:`Do not promote to multi-part`: Geometries will be imported as single-part geometries.
- |checkbox| :guilabel:`Convert field names to lower case`: All field names will be converted to lower case.
- |checkbox| :guilabel:`Create spatial index`: A spatial index will be created on the geometry column after import.
- |checkbox| :guilabel:`Comment`: Add comments to table. Only available for PostgreSQL databases.

.. figure:: img/db_manager_import.png
:align: center
:width: 400px

Importing a vector layer into a spatial database using DB Manager


Export to Vector File
---------------------------

To export a table from your database to a vector file, select
the desired :guilabel:`Format` and :guilabel:`Save as` location.
Under :guilabel:`Options`, you can set the following parameters:

* |checkbox| :guilabel:`Source SRID`: Define the source SRID of the geometry column.
By default, it uses the layer's CRS.
* |checkbox| :guilabel:`Target SRID`: Define the target SRID to reproject the geometries
during the export process. By default, it uses the layer's CRS.
* |checkbox| :guilabel:`Encoding`: Define the encoding of the output data.
* |checkbox| :guilabel:`Replace destination table (if exists)`: If a table with the same name already exists at the selected location,
it will be replaced.

.. figure:: img/db_manager_export.png
:align: center
:width: 400px

Exporting a table to a vector file using DB Manager



.. Substitutions definitions - AVOID EDITING PAST THIS LINE
This will be automatically updated by the find_set_subst.py script.
If you need to create a new substitution manually,
please add it also to the substitutions.txt file in the
source folder.


.. |checkbox| image:: /static/common/checkbox.png
:width: 1.5em
.. |dbManager| image:: /static/common/dbmanager.png
:width: 1.5em