File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,28 @@ async def main() -> None:
6161 dict_results: list[dict[str , Any]] = results.result()
6262```
6363
64+ ### Execute Batch
65+
66+ #### Parameters:
67+
68+ - ` querystring ` : querystrings separated by semicolons.
69+
70+ Executes a sequence of SQL statements using the simple query protocol.
71+
72+ Statements should be separated by semicolons.
73+ If an error occurs, execution of the sequence will stop at that point.
74+ This is intended for use when, for example,
75+ initializing a database schema.
76+
77+ ``` python
78+ async def main () -> None :
79+ ...
80+ connection = await db_pool.connection()
81+ await connection.execute_batch(
82+ " CREATE TABLE psqlpy (name VARCHAR); CREATE TABLE psqlpy2 (name VARCHAR);" ,
83+ )
84+ ```
85+
6486### Fetch
6587
6688#### Parameters:
Original file line number Diff line number Diff line change @@ -144,6 +144,29 @@ async def main() -> None:
144144 dict_results: list[dict[str , Any]] = results.result()
145145```
146146
147+ ### Execute Batch
148+
149+ #### Parameters:
150+
151+ - ` querystring ` : querystrings separated by semicolons.
152+
153+ Executes a sequence of SQL statements using the simple query protocol.
154+
155+ Statements should be separated by semicolons.
156+ If an error occurs, execution of the sequence will stop at that point.
157+ This is intended for use when, for example,
158+ initializing a database schema.
159+
160+ ``` python
161+ async def main () -> None :
162+ ...
163+ connection = await db_pool.connection()
164+ async with connection.transaction() as transaction:
165+ await transaction.execute_batch(
166+ " CREATE TABLE psqlpy (name VARCHAR); CREATE TABLE psqlpy2 (name VARCHAR);" ,
167+ )
168+ ```
169+
147170### Fetch
148171
149172#### Parameters:
You can’t perform that action at this time.
0 commit comments