Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

commit=True by default in PostgresNode.execute() and document it.#28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
funbringer merged 1 commit intopostgrespro:masterfromarssher:master
Nov 16, 2017
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,7 +98,7 @@ Finally our temporary cluster is able to process queries. There are four ways to

* `node.psql(database, query)` - runs query via `psql` command and returns tuple `(error code, stdout, stderr)`
* `node.safe_psql(database, query)` - same as `psql()` except that it returns only `stdout`. If an error occures during the execution, an exception will be thrown.
* `node.execute(database, query)` - connects to postgresql server using `psycopg2` or `pg8000` library (depends on which is installed in your system) and returns two-dimensional array with data.
* `node.execute(database, query, username=None, commit=True)` - connects to postgresql server using `psycopg2` or `pg8000` library (depends on which is installed in your system) and returns two-dimensional array with data.
* `node.connect(database='postgres')` - returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction.

The last one is the most powerful: you can use `begin(isolation_level)`, `commit()` and `rollback()`:
Expand Down
2 changes: 1 addition & 1 deletiontestgres/testgres.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -962,7 +962,7 @@ def poll_query_until(self,

raise TimeoutException('Query timeout')

def execute(self, dbname, query, username=None, commit=False):
def execute(self, dbname, query, username=None, commit=True):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@ildus, @gsmol,@sfalkon, у вас есть тесты, которые завязаны наcommit=False по умолчанию?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@funbringer у меня нет, тем более я всегда делал вручную, без параметра

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Нет таких

"""
Execute a query and return all rows as list.

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp