Datasource

../../../../_images/datasource.svg

Create a datasource from some resource location specification (file path, database connection, url)

Documentation

The primary usecase for this node is to specify a resource for use with an import or export node. But in principle, any node may use the resulting datasource.

File

Choose from existing filenames on disk or edit the filename directly to point to a non-existing file. For example, to point to output an file that has not yet been created.

The path can be entered either as an absolute path or relative to some other path (top-flow, sub-flow or library root).

All filenames are made absolute and normalized before they are written to the output and even the options which allow you to specify relative filenames will result in absolute output filenames.

Absolute path

Absolute path is the most basic selection. Input the absolute filename and that filename will be used as output.

Relative to top-flow

Relative to top-flow is used to express filenames relative to the file of the top-flow (the .syx file opened from disk).

Relative to sub-flow

Relative to sub-flow is used to express filenames relative to the file of the sub-flow. The sub-flow location can be different from that of the top-flow when the Datasource node is part of a linked sub-flow.

Relative to library root

Relative to library is used to express filenames relative to the library location of the current sub-flow node. This option is only available for sub-flow nodes added to a library and offers a way to express paths to other resources within the same library.

Database

Specify properties for SQLAlchemy or ODBC database connections.

See Engine for details about how to specify SQLAlchemy engine URL for different databases.

See Connection String Syntax for information about how to specify ODBC connection strings.

URL

Specify an URL, for example, in HTTP(s) scheme. URL environment might be handled differently depending on the scheme and corresponds to HTTP headers for the HTTP(s) case.

If URL resource contains credential variables for login or token credentials these might later be entered as part of the URL.

See Credentials Preferences for more info.

Definition

Output ports

port1 datasource

Datasource with file path

Configuration

Datasource type (datasource_type)

Type of datasource.

Connection (db_connection_string)

A connection string that will override other settings.

Database name (db_databasename)

The name of the database.

Database driver (db_driver)

Database driver to use.

Database connection method (db_method)

Select which Database connection method that you want to use.

Password (db_password)

A valid password for the selected user.

Server name (db_servername)

A valid name to a database server.

SQLAlchemy engine URL (db_sqlalchemy_engine_url)

SQLAlchemy engine URL for connecting to the database

User (db_user)

A valid database user.

Filename (filename)

A filename including path if needed

Connection string (odbc_connection)

A connection string that will override other settings.

Can use the credential system for storing credentials outside of the node’s configuration. For more information, see the Credentials section of the documentation.

Engine (sqlalchemy_connection)

SQLAlchemy engine URL for connecting to the database

Can use the credential system for storing credentials outside of the node’s configuration. For more information, see the Credentials section of the documentation.

URL (url_connection)

Uniform Resource Locator (URL)

Can use the credential system for storing credentials outside of the node’s configuration. For more information, see the Credentials section of the documentation.

Environment (url_env)

Environment for URL. Used as headers in case of HTTP URL. Input as a Python expression that evaluates to.

String (url_str)

Uniform Resource Locator (URL) string

Examples

Implementation

class node_file_datasource.FileDatasource[source]