Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Genie Flow Invoker MS SQL Server

This invoker package includes interfaces to Microsoft SQL Server.

Install

Simply pip install genie-flow-invoker-ms-sql-server will install this set of invokers. In the file requirements.txt of your agent, just add this package as requirement.

Server Configuration

Configuring these invokers involves specifying the server name, username and password. Since these invokers use pymssql to interface with the MS SQL Server, information about the database connection can be found here

These can be configured in the meta.yaml file that is stored in the template directory, but these parameters also have an environment variable, as follows:

  • MS_SQL_SERVER: server
  • MS_SQL_SERVER_USERNAME: username
  • MS_SQL_SERVER_PASSWORD: password
  • MS_SQL_SERVER_DATABASE: database
  • MS_SQL_SERVER_TABLE: table

To prevent these invokers from flooding the system, it is important to limit the number of records that are returned. We need to put an absolute cap on the total number of records returned.

BEWARE: retrieving all data from a very large table will break your agent - it will run out of memory.

Retrieve from table - MSSQLServerRetrieveInvoker

This invoker retrieves records from an existing table.

By specifying the attribute top, only the specified number of records will be returned. A default can be specified with the configuration of the invoker.

If no top has been specified, all records will be returned

An optional sort order can be given, where the fields to sort by (ascending or descending) can be specified.

sort_order : The order in which records should be returned is specified by a list of column names. Columns should be stated in decreasing level of precedence. By default, the columns are ordered in Ascending order. Ordering in Descending order can be achieved by prepending the column name with a - sign.

Override

The values stored in meta.yaml form the base configuration. Any of these configuration values can be overriden by specifying them in the content of the invocation. For example, if you want to make the top parameter dependent of user content, then you can provide content as follows:

{
  "top": 12
}

which will override any value that may be configured in the meta.yaml file.

Return values

Records are returned as JSON objects with a key for every column and their accompanying value.

Return value would look like:

{
  "results": [
    {
      "col1": "value",
      "col2": 1234
    },
    {
      "col1": "another value",
      "col2": 5678
    }
  ]
}

Here we have just one list of two records, each with the same columns but different values.

Store into table - MSSQLServerStoreInvoker

This invoker will store values into a table. The data expected is either a simple dictionary stating all (required) columns and their value, or a list of such objects.

Configuration of this store invoker can potentially contain a list of columns that form the primary key of the table. This means that a verification is done (by the server) to make sure that new records will have a unique set of values for those columns.

If no primary key is defined, no special effort will be made to ensure uniqueness. Also, this invoker can only add new records to the table as there would be no way to identify already existing records to update.

storage strategy

One can configure what should be done when a conflicting primary key is used. The strategies are "insert", "update" or "upsert". The first (insert) means: a record with that primary key should not yet exist and generate an error if it does. The second (update) means: a record with that key should already exist and the new values overwrite already existing values. This strategy would generate an error if such record does not yet exist. The final strategy (upsert) means that, if a record with the same primary key already exists, the values are updated. If not, a new record is created.

When an update happens (so a record already exists with the same primary key), one can suffice with only sending the columns that need to be updated - irrespective if columns have been defined as NON NULL. Only the columns stated will then be updated.

storage feedback

Feedback on whether the data is stored or is sent back as a dictionary of the following form:

{
  "results": [
    "updated",
    "missing"
  ]
}

Which would denote the successful updating of the first record, but an update that could not be made because the specified primary key did not exist.

The following results can be returned for the different strategies:

strategy updated missing added conflicting
insert * *
update * *
upsert * *

Run SQL Query -- MSSQLServerQueryInvoker

For generic SQL queries, this invoker will pass what-ever query is sent to it, to the SQL Server. Results are sent back to the client, using the same pagination logic as specified above.

The content passed to this invoker is passed as SQL Query to the server. The object returned is the same as what gets returned from the MSSQLServerRetrieveInvoker.

Metadata

Release files for genie-flow-invoker-ms-sql-server 0.7.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for genie-flow-invoker-ms-sql-server 0.7.0a1
File Size Uploaded Provenance Actions
genie_flow_invoker_ms_sql_server-0.7.0a1.tar.gz 13.3 kB Without provenance Details for genie_flow_invoker_ms_sql_server-0.7.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for genie-flow-invoker-ms-sql-server 0.7.0a1
File Interpreter ABI Platform Actions
genie_flow_invoker_ms_sql_server-0.7.0a1-py3-none-any.whl Python 3 none any Details for genie_flow_invoker_ms_sql_server-0.7.0a1-py3-none-any.whl

Total release size: 26.8 kB

Release files / genie_flow_invoker_ms_sql_server-0.7.0a1.tar.gz

Download URL genie_flow_invoker_ms_sql_server-0.7.0a1.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
422bbbcea3a5c37241dc85bddec2505d06992c2418c53f8b9b9eb5302ef24b2a
BLAKE2b-256 checksum
How to use checksums
423a9b10b7d943796d2daafff7f94259ff933831dbe275b0bd904db212f65ba6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / genie_flow_invoker_ms_sql_server-0.7.0a1-py3-none-any.whl

Download URL genie_flow_invoker_ms_sql_server-0.7.0a1-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f756cbf3a2f9423a1948fbed820903fb49a5f32c58b706322ec034cb016c96cf
BLAKE2b-256 checksum
How to use checksums
dbde5dc4fb6258805a3ca0fd50f616ead4d75a45cc435ae9537602a4793384c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Security for genie-flow-invoker-ms-sql-server 0.7.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page