question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Discussion: `SqliteTask`

See original GitHub issue

I 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.

cc: @jlowin @joshmeek

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cicdwcommented, Oct 25, 2018

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.

0reactions
jlowincommented, Oct 25, 2018

+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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found