turbot / steampipe-plugin-csv

Use SQL to instantly query data from CSV files. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/csv
Apache License 2.0
19 stars 4 forks source link

foreign table persists when csv file is deleted (or, presumably, renamed) #2

Closed judell closed 2 years ago

judell commented 3 years ago

connection "csv" } plugin = "csv" paths = [ "/home/jon/csv/*.csv" ] }

cat > fruit.csv name,color apple,red

select * from csv.fruit name,color apple,red

rm fruit.csv select * from csv.fruit ... hangs ...

sudo -u root psql -d steampipe -h localhost -p 9193

select * from information_schema.foreign_tables

steampipe, csv, fruit, steampipe, steampipe

drop foreign table csv.fruit

cat > fruit.csv name,color apple,red

select * from csv.fruit name,color apple,red

judell commented 3 years ago

My excitement about this plugin keeps growing. I've looked around at various ways of bringing CSV into Postgres, including the COPY recipes, and also the built-in file_fdw. I've yet to find one that's dynamic with respect to the table schema, in the way this plugin is.

For type conversion, it can be as easy as this.

cat > fruit.csv name,color,size apple,red,10

create table fruit as ( select name, color, size::int from csv.fruit)

\d fruit

name | text color | text size | integer

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 90 days with no activity.