PostgreSQL driver/backend doesn't honour the value of the new db_schema_name.
Currently ingest only seems to write into the "public" schema.
Ref: #1056.
Example
from adbc_driver_postgresql.dbapi import connect
import pyarrow as pa
test_data = pa.Table.from_pydict({
"key": ["aa", "bb", "cc"],
"value": [10, 20, 30],
})
# adjust URI as needed (I have a test instance in a local container)
uri = "postgresql://postgres@localhost:5432/postgres"
# schema/table into which the test data will be written
target_table = "tbl_test_data"
target_schema = "demo_schema"
create_schema = f"CREATE SCHEMA IF NOT EXISTS {target_schema}"
# ingest, setting the target db schema name
with connect(uri) as conn, conn.cursor() as cursor:
cursor.execute(create_schema)
cursor.adbc_ingest(
table_name = target_table,
data = test_data,
mode = "create",
db_schema_name = target_schema,
)
conn.commit()
Result