Skip to content

[FEATURE] Accept kwargs for execute and executeStmt #1

Open
@jeffreyaven

Description

@jeffreyaven

Feature Description
Allow kwargs to be supplied to the execute and executeStmt methods, named arguments supplied to these methods will override either equivalents which were supplied in the StackQL class constructor.

Example(s)

from pystackql import StackQL
provider_auth =  {
    "github": {
        "credentialsenvvar": "GITHUBCREDS",
        "type": "basic"
    }
}
stackql = StackQL(auth=provider_auth, output="csv")
print(stackql.execute("select id, name from github.repos.repos where org = 'stackql'"))

# returns: 
# id,name
# 443987542,stackql
# 441087132,stackql-provider-registry
# 455730530,pystackql
#456722161,stackql-jupyter-demo
# ...

print(stackql.execute("select id, name from github.repos.repos where org = 'stackql'", output="json"))

# returns:
# [{"id":"443987542","name":"stackql"},{"id":"441087132","name":"stackql-provider-registry"},...]

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions