This commit is contained in:
Lev Kokotov
2023-04-22 08:02:20 -07:00
parent 088f1a7dae
commit fd3623ff13
3 changed files with 12 additions and 4 deletions

View File

@@ -107,6 +107,9 @@ cd ../..
# #
pip3 install -r tests/python/requirements.txt pip3 install -r tests/python/requirements.txt
python3 tests/python/tests.py || exit 1 python3 tests/python/tests.py || exit 1
start_pgcat "info"
python3 tests/python/async_test.py python3 tests/python/async_test.py
start_pgcat "info" start_pgcat "info"

View File

@@ -569,6 +569,8 @@ impl Server {
let code = message.get_u8() as char; let code = message.get_u8() as char;
let _len = message.get_i32(); let _len = message.get_i32();
trace!("Message: {}", code);
match code { match code {
// ReadyForQuery // ReadyForQuery
'Z' => { 'Z' => {

View File

@@ -2,15 +2,18 @@ import psycopg2
import asyncio import asyncio
import asyncpg import asyncpg
PGCAT_HOST = "127.0.0.1"
PGCAT_PORT = "6432"
def regular_main(): def regular_main():
# Connect to the PostgreSQL database # Connect to the PostgreSQL database
conn = psycopg2.connect( conn = psycopg2.connect(
host="localhost", host=PGCAT_HOST,
database="sharded_db", database="sharded_db",
user="sharding_user", user="sharding_user",
password="sharding_user", password="sharding_user",
port=6432, port=PGCAT_PORT,
) )
# Open a cursor to perform database operations # Open a cursor to perform database operations
@@ -34,11 +37,11 @@ def regular_main():
async def main(): async def main():
# Connect to the PostgreSQL database # Connect to the PostgreSQL database
conn = await asyncpg.connect( conn = await asyncpg.connect(
host="localhost", host=PGCAT_HOST,
database="sharded_db", database="sharded_db",
user="sharding_user", user="sharding_user",
password="sharding_user", password="sharding_user",
port=6432, port=PGCAT_PORT,
) )
# Execute a SQL query # Execute a SQL query