Skip to content

taipy.core.data.SQLTableDataNode

Bases: _AbstractSQLDataNode

Data Node stored in a SQL table.

Attributes:

Name Type Description
config_id str

Identifier of the data node configuration. It must be a valid Python identifier.

scope Scope

The scope of this data node.

id str

The unique identifier of this data node.

owner_id str

The identifier of the owner (sequence_id, scenario_id, cycle_id) or None.

parent_ids Optional[Set[str]]

The identifiers of the parent tasks or None.

last_edit_date datetime

The date and time of the last modification.

edits List[Edit]

The ordered list of edits for that job.

version str

The string indicates the application version of the data node to instantiate. If not provided, the current version is used.

validity_period Optional[timedelta]

The duration implemented as a timedelta since the last edit date for which the data node can be considered up-to-date. Once the validity period has passed, the data node is considered stale and relevant tasks will run even if they are skippable (see the Task management page for more details). If validity_period is set to None, the data node is always up-to-date.

edit_in_progress bool

True if a task computing the data node has been submitted and not completed yet. False otherwise.

editor_id Optional[str]

The identifier of the user who is currently editing the data node.

editor_expiration_date Optional[datetime]

The expiration date of the editor lock.

properties dict[str, Any]

A dictionary of additional properties. Note that the properties parameter must at least contain an entry for "db_name", "db_engine", "table_name":

  • "db_name" (str): The database name, or the name of the SQLite database file.
  • "db_engine" (str): The database engine. For now, the accepted values are "sqlite", "mssql", "mysql", or "postgresql".
  • "table_name" (str): The name of the SQL table.
  • "db_username" (str): The database username.
  • "db_password" (str): The database password.
  • "db_host" (str): The database host. The default value is "localhost".
  • "db_port" (int): The database port. The default value is 1433.
  • "db_driver" (str): The database driver.
  • "sqlite_folder_path" (str): The path to the folder that contains SQLite file. The default value is the current working folder.
  • "sqlite_file_extension" (str): The filename extension of the SQLite file. The default value is ".db".
  • "db_extra_args" (Dict[str, Any]): A dictionary of additional arguments to be passed into database connection string.
  • "exposed_type": The exposed type of the data read from SQL query. The default value is pandas.

__insert_dicts(data, table, connection, delete_table) classmethod

This method will insert the data contained in a list of dictionaries into a table. The query itself is handled by SQLAlchemy, so it's only needed to pass the correct data type.

__insert_tuples(data, table, connection, delete_table) classmethod

This method will look up the length of the first object of the list and build the insert through creation of a string of '?' equivalent to the length of the element. The '?' character is used as placeholder for a tuple of same size.