Postgres Tasks
See original GitHub issueUsing https://github.com/psycopg/psycopg2 let’s add some tasks for working with a postgres database. The main function that we should add is execute
which takes in an arbitrary SQL string to execute against a db.
On immediate appearance the ExecuteTask
(or whatever it becomes called) should take in a db host, db name, user, pass, SQL string, data tuple, and optional commit param. http://initd.org/psycopg/docs/cursor.html?highlight=execute#cursor.execute
There are other functions such as fetchone
, fetchmany
, rowcount
, etc… that may only be slightly useful and we should use this issue as a means to debate what we think is important. (http://initd.org/psycopg/docs/cursor.html)
cc @jlowin for your psycopg2 expertise
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Chapter 25. Routine Database Maintenance Tasks
PostgreSQL, like any database software, requires that certain tasks be performed regularly to achieve optimum performance. The tasks discussed here are ...
Read more >Postgres Tasks - Prefect Docs
This module contains a collection of tasks for interacting with Postgres databases via the psycopg2 library. # PostgresExecute. class. prefect.tasks.postgres.
Read more >PostgreSQL Exercises
The exercises on this site range from simple select and where clauses, through joins and case statements, and on to aggregations, window functions,...
Read more >An Overview of Job Scheduling Tools for PostgreSQL
The tasks to perform can be any of the following ones: stored procedures; SQL statements; PostgreSQL commands (as VACUUM, or VACUUM ANALYZE).
Read more >Common DBA tasks for Amazon RDS for PostgreSQL
Learn how to perform some common DBA tasks on DB instances running the Amazon RDS for PostgreSQL database engine.
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
I’ll add in a separate task for
fetch
for now too and we can go from thereGood question, I think
execute
is the most useful in it’s ability to essentially allow any SQL command. If you see any others inpsycopg2
which seem crucial for a Postgres aspect of someone’s workflow I welcome them butexecute
is a good first step!