caiiiycuk / postgresql-to-sqlite

pg2sqlite is easy to use solution to create sqlite database from postgresql dump
MIT License
129 stars 11 forks source link

Usage in Node Js #24

Closed fwt-parth-jariwala closed 5 months ago

fwt-parth-jariwala commented 5 months ago

I have extracted zip file in my nodejs project and it has created a new directory in it. Now how can i use it to convert my postgres sql file to sqlite db conversion?

caiiiycuk commented 5 months ago

HI, as explaind in README file you need to run it with following arguments:

java -jar  pg2sqlite-1.0.3.jar -d database.dump -o sqlite.db

The way to run it is not related to Node.js. You should run it as a separate process, as an external program. In the end, it is executed on the JVM and does not know anything about Node.

fwt-parth-jariwala commented 5 months ago

I am runnig on ubuntu 20.04 and when i run command java -jar pg2sqlite-1.0.3.jar -d database.dump -o sqlite.db it gives me error:command not found: java

caiiiycuk commented 5 months ago

Obviously you need to install java:

sudo apt install openjdk-21-jre
fwt-parth-jariwala commented 5 months ago

I have following java versionm image

caiiiycuk commented 5 months ago

so then you can run pg2sqlite-1.0.3.jar

fwt-parth-jariwala commented 5 months ago

Can you tell me how can i run it node js?

caiiiycuk commented 5 months ago

Can you tell me how can i run it node js?

https://stackoverflow.com/questions/20643470/execute-a-command-line-binary-with-node-js