simonw / db-to-sqlite

CLI tool for exporting tables or queries from any SQL database to a SQLite file
Apache License 2.0
370 stars 29 forks source link

Views, Materialized Views, Functions not exported from Postgres database to SQLite file #36

Open priyadarshiniguptan opened 3 years ago

priyadarshiniguptan commented 3 years ago

I am trying to export a few schemas from my postgres database to SQLite as below:

/home/admin/.local/bin/db-to-sqlite "postgresql://postgres:postgres@10.10.10.171:5432/configuration" cplabor.db --all --postgres-schema dbd_cp_labor

This particular schema has views , materialized views , functions and datatypes as well apart from tables. However when I run -

❯ sqlite3 cplabor.db
SQLite version 3.27.2 2019-02-25 16:06:06
Enter ".help" for usage hints.
sqlite> Select * from dbd_cp_labor.vw_revenue_by_year;
Error: no such table: dbd_cp_labor.vw_revenue_by_year
sqlite> Select * from vw_revenue_by_year;
Error: no such table: vw_revenue_by_year

I am able to see only the tables and not the views or functions. Could I be missing something here. Please guide.

RonnyPfannschmidt commented 3 years ago

sqlite does not support function and materialized views in the postgresql sense

same goes for data types, i suspect viws also don't transfer easily