Skip to content

Commit 004b6e5

Browse files
committed
Fix styling and documentation
1 parent 347a661 commit 004b6e5

4 files changed

Lines changed: 17 additions & 13 deletions

File tree

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let ctx = SessionContext::with_state(state);
2727
- Flight SQL
2828
- ODBC
2929

30-
## Examples
30+
## Examples (in Rust)
3131

3232
Run the included examples to see how to use the table providers:
3333

@@ -45,6 +45,7 @@ cargo run --example duckdb_function --features duckdb
4545
### SQLite
4646

4747
```bash
48+
# Run from repo folder
4849
cargo run --example sqlite --features sqlite
4950
```
5051

@@ -69,10 +70,8 @@ EOF
6970
```
7071

7172
```bash
72-
# If running from core/ folder
73-
cargo run --example postgres --features postgres
74-
# If running from main repo folder
75-
cargo run -p datafusion-table-providers --example postgres --no-default-features --features postgres
73+
# Run from repo folder
74+
cargo run -p datafusion-table-providers --example postgres --features postgres
7675

7776
```
7877

@@ -97,10 +96,8 @@ EOF
9796
```
9897

9998
```bash
100-
# If run from core/ folder
101-
cargo run --example mysql --features mysql
102-
# If run from main repo folder
103-
cargo run -p datafusion-table-providers --example mysql --no-default-features --features mysql
99+
# Run from repo folder
100+
cargo run -p datafusion-table-providers --example mysql --features mysql
104101
```
105102

106103
### Flight SQL
@@ -111,7 +108,8 @@ brew install roapi
111108
# cargo install --locked --git https://github.com/roapi/roapi --branch main --bins roapi
112109
roapi -t taxi=https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_2024-01.parquet &
113110

114-
cargo run -p datafusion-table-providers --example flight-sql --no-default-features --features flight
111+
# Run from repo folder
112+
cargo run -p datafusion-table-providers --example flight-sql --features flight
115113
```
116114

117115
### ODBC
@@ -138,3 +136,9 @@ Description = SQLite3 ODBC Driver
138136
Driver = /opt/homebrew/Cellar/sqliteodbc/0.99991/lib/libsqlite3odbc.dylib
139137
```
140138
4. Test configuration by running `odbcinst -q -d -n SQLite3`. If the path is printed out correctly, then you are all set.
139+
140+
## Examples (in Python)
141+
1. Start a Python venv
142+
2. Enter into venv
143+
3. Inside python/ folder, run `maturin develop`.
144+
4. Inside python/examples/ folder, run the corresponding test using `python3 [file_name]`.

core/examples/duckdb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async fn main() {
1919
// Opening in ReadOnly mode allows multiple reader processes to access
2020
// the database at the same time
2121
let duckdb_pool = Arc::new(
22-
DuckDbConnectionPool::new_file("examples/duckdb_example.db", &AccessMode::ReadOnly)
22+
DuckDbConnectionPool::new_file("core/examples/duckdb_example.db", &AccessMode::ReadOnly)
2323
.expect("unable to create DuckDB connection pool"),
2424
);
2525

core/examples/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async fn main() {
2020
// - arg3: Connection timeout duration
2121
let sqlite_pool = Arc::new(
2222
SqliteConnectionPoolFactory::new(
23-
"examples/sqlite_example.db",
23+
"core/examples/sqlite_example.db",
2424
Mode::File,
2525
Duration::from_millis(5000),
2626
)

core/src/sql/db_connection_pool/postgrespool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{collections::HashMap, future::Future, path::PathBuf, str::FromStr, sync::Arc};
1+
use std::{collections::HashMap, path::PathBuf, str::FromStr, sync::Arc};
22

33
use crate::{
44
util::{self, ns_lookup::verify_ns_lookup_and_tcp_connect},

0 commit comments

Comments
 (0)