use std::{collections::HashMap, sync::Arc}; use datafusion::{prelude::SessionContext, sql::TableReference}; use datafusion_table_providers::{ postgres::PostgresTableFactory, sql::db_connection_pool::postgrespool::PostgresConnectionPool, util::secrets::to_secret_map, }; /// This example demonstrates how to register a table provider into DataFusion that /// uses a Postgres table as its source. /// /// Use docker to start a Postgres server this example can connect to: /// /// ```bash /// docker run --name postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=postgres_db -p 5432:5432 -d postgres:16-alpine /// # Wait for the Postgres server to start /// sleep 30 /// /// # Create a table in the Postgres server and insert some data /// docker exec -i postgres psql -U postgres -d postgres_db <