Discussion: `SqliteTask`
See original GitHub issueI am currently working on a simple implementation of a SqliteTask
for interacting with sqlite3
databases.
What I’d like to support:
- executing single statements and returning the values of
fetchall()
(or some prespecified number of return rows) - executing full sql scripts (either as a string or read from a file); note that if you execute a script only, there is nothing to return
My current sketch design idea:
class SqliteTask(Task):
def __init__(self, statement: str = None,
script: str = None, db: str = ":memory:",
return_rows: int = 0, **kwargs):
...
Moreover, if you provide both script
and statement
, the script
will be executed first and the statement
last, in case it’s a SELECT
statement to query what just happened in the script.
I’m opening this issue for discussion in case this is overloading the task with too many parameters / options / possibilities. I want to make sure it’s still clear as a single Task
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Enhancing Time Slice with User Property - Extension Ideas ...
I would like to have a single work item, Support, and then hang an incident number, as a property, on each time slice...
Read more >SQLite Tasks | Prefect Docs
Task for executing a single query against a sqlite3 database; returns the result (if any) from the query. Args: db (str, optional) :...
Read more >Hi, I have a small SQLite task. Let me know if anyone interested ...
SQL & SQLite Projects for $2 - $8. Hi, I have a small SQLite task. Let me know if anyone interested...
Read more >Plugins - DokuWiki
Insert a gravatar into a wiki page, also needed by the discussion plugin. Provides: Syntax, Helper; Tags: avatar, discussion, embed, images, media ...
Read more >SQLite Self-Assessment: Who is responsible for ensuring ...
... include every SQLite task and that every SQLite outcome is in place ... and share among the participants to prepare and discuss...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yea; I don’t think that, in implementing this sqlite functionality, I should use any Prefect conditionals – if we agree the goals are distinct enough, I’ll just make two different tasks that the user has to choose from.
+1
I’d almost always vote in favor of smaller tasks that can be combined into complex flows than larger tasks that do conditional logic internally.