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

Commita1ac4fb

Browse files
authored
Merge pull request#28 from arssher/master
commit=True by default in PostgresNode.execute() and document it.
2 parentsaaf73ff +5f57cb6 commita1ac4fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Finally our temporary cluster is able to process queries. There are four ways to
9898

9999
*`node.psql(database, query)` - runs query via`psql` command and returns tuple`(error code, stdout, stderr)`
100100
*`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.
101-
*`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.
101+
*`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.
102102
*`node.connect(database='postgres')` - returns connection wrapper (`NodeConnection`) capable of running several queries within a single transaction.
103103

104104
The last one is the most powerful: you can use`begin(isolation_level)`,`commit()` and`rollback()`:

‎testgres/testgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ def poll_query_until(self,
962962

963963
raiseTimeoutException('Query timeout')
964964

965-
defexecute(self,dbname,query,username=None,commit=False):
965+
defexecute(self,dbname,query,username=None,commit=True):
966966
"""
967967
Execute a query and return all rows as list.
968968

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp