GeoProcessor / Command / OpenDataStore
Overview
The OpenDataStore command creates a generic DataStore to provide
data access from:
- a database
- a web service
The OpenDataStore command can also be used to open an existing
DataStore previously closed with the CloseDataStore command.
- Set the
DataStoreIDparameter to the ID of the closed DataStore. - Set the
IfDataStoreIDExistsparameter toOpen.
A new DataStore can be opened in 2 ways:
- Parameters configure datastore
- the DataStore configurations (Database Dialect, Database Server, etc.) are set via command parameters
- the
DataStoreID,DatabaseServer,DatabaseDialect,DatabaseName,DatabaseUserandDatabasePasswordparameters are required - the
IfDataStoreIDExistsandDatabasePortparameters are optional
- Configuration file configures datastore
- the DataStore configurations (Database Dialect, Database Server, etc.) are set via a configuration file
- the
DataStoreIDandConfigFileparameters are required - the
IfDataStoreIDExistsparameter is optional
DataStore features in the GeoProcessor currently focus on relational databases that can
be queried to return tabular datasets.
In the future, support for web services will be added.
See also the CloseDataStore command to close a DataStore.
This command can be used to control DataStore connections in a workflow. The GeoProcessor is being enhanced to open DataStores at software startup, for cases where a DataStore needs to be available for the entire software session.
For security reasons, the account name and password used for the connection should generally not be directly
included in the command parameters. This is less of an issue for read-only guest accounts.
To allow flexibility, use the ${env:Property} notation to specify that the parameter value
is taken from an environment variable, and set the environment variable dynamically in the run-time environment.
Database DataStores are implemented using Pandas Python package Data Frame, SQLAlchemy package and appropriate database driver software.
SQLAlchemy Database Dialects
The following are the available SQLAlchemy database dialects:
DatabaseDialect Parameter |
Default Port | Supported in the GeoProcessor? |
|---|---|---|
PostgreSQL |
5432 | Supported |
Firebird |
3050 | Not Supported |
Microsoft SQL Server |
1433 | Not Supported |
MySQL |
3306 | Not Supported |
Oracle |
- | Not Supported |
SQLite |
- | Not Supported |
Sybase |
5000 | Not Supported |
Command Editor
The following dialog is used to edit the command and illustrates the command syntax.
Need to implement UI.
Command Syntax
The command syntax is as follows:
OpenDataStore(Parameter="Value",...)
Command Parameters
| Parameter Scope | Parameter | Description | Default |
|---|---|---|---|
| All | DataStoreIDrequired |
Identifier to assign to the DataStore. This allows the DataStore to be used with other commands. Can be specified using ${Property}. |
None - must be specified. |
| All | IfDataStoreIDExists |
The action that occurs if the DataStoreID already exists within the GeoProcessor:
|
Replace |
| Parameters configure datastore | DatabaseServerrequired |
The database server name or IP address. Can be specified using ${Property}. |
None - must be specified. |
| Parameters configure datastore | DatabaseDialectrequired |
The database dialect, used to format the database connection URL for the matching database driver software. See the table above for a list of supported dialects. |
None - must be specified. |
| Parameters configure datastore | DatabaseNamerequired |
The name of the database. Can be specified using ${Property}. |
None - must be specified. |
| Parameters configure datastore | DatabaseUserrequired |
The database user. A read-only "guest" (or similar) account should be used for read-only operations, if possible. Can be specified using ${Property}. |
None - must be specified. |
| Parameters configure datastore | DatabasePasswordrequired |
The database password. Can be specified using ${Property}. |
None - must be specified. |
| Parameters configure datastore | DatabasePortoptional |
The database port. See the table above for the database default ports. |
The default port for the DatabaseDialect. |
| Configuration file configures datastore | ConfigFilerequired |
The path (relative or absolute) to the file containing the database configurations. | None - must be specified. |
Examples
The automated tests for this command have not yet been created.
Currently in development queue.
See the automated tests.
Troubleshooting
See Also
CloseDataStore- close a DataStoreReadTableFromDataStore- read a table from a DataStoreWriteTableToDataStore- write a table to a DataStore