Connect sqlite database into excel spreadsheet from node - node.js

I need to run this commands from node.js (i'm using sqlite3 package):
sqlite3 example-db.db
.headers on
.excel
select * from table;
is it possible?

Related

Bulk psql data COPY from stdin in nodeJs

I need to load the data in psql db time-to-time via a node app.
I'm using node-postgres package, which seems to be working fine with INSERT statements.
Since my db_dum is huge, I need to move to COPY statement in pg_dump (for better performance), but getting all kinds of error while trying to load the data with pg package in Node - This works find if I use command line psql
the psql dump file I have is huge which includes COPY statements like this:
COPY hibernate.address (id, create_timestamp,
update_timestamp, street_address_line_1, street_address_line_2, city, state_code, postal_code, postal_code_suffix, country_code, latitude, longitude, updated_by_base_user_id) FROM stdin;
379173 2017-02-20 02:34:17.715-08 2018-01-20 08:34:17.715-08 3 Brewster St \N Phoenix AZ 17349 \N US \N \N 719826
/.
Here's a pseudo code for the node app running the sql dump file:
const sqlFile = fs.readFileSync('data_dump.sql').toString();
const connectionString = `postgres://<user>:${PgPassword}#${pgIpAndPort}/<table>`;
const client = new pg.Client(connectionString);
lient.connect();
client.query(sqlFile);
Here's a sample pg_dump command I use (which is for data-only - no schema):
pg_dump -U <user> --data-only --disable-triggers -n hibernate <table_name> > <dump_file.sql>
but it doesn't work when I'm trying to load the data via node app
I know --column-inserts would solve the problem, but that decreases the performance drastically.
So I'm looking for possible solutions for loading the data with COPY tbl FROM stdin; statement in the node app
Any suggestion/comments is appreciated.

How can i send multiple queries in jaydebeapi in python (Netezza JDBC)

How to send multiple queries in single execute statement for example simplified version of my query is (which i am trying to execute using jaydebeapi )
Create temp table tempTable as
select * from table1 where x=y;
select * from tempTable ;
UPDATE : I am using Netezza JDBC

Robot Framework: save SQL results to excel

I just started to automate our test process. I made the following case:
Example:
* Settings *
Library Selenium2Library
Library Remote http://localhost:0000/ WITH NAME JDBCDB2 #DB2
Library ExcelLibrary
* Test Cases *
Connect to database connection parm login password
Store Query Result To File select * from table where x=y :\Testresults.txt
what keyword to use (instead of Store query results to file) so i can read the query from a file, instead of writing the full select statement.
How to write the sql results to an excel. Results seperated in columns/records

How to get data exported into excel from Postgres using nodeJs terminal?

I need to create NodeJS module that will export data from query(Postgres) into excel file.
This module should start from terminal line like "node index.js id = (some id)"
I do have query from db.
- How to realize this module ? I am breaking my head for 2 days now...

Import csv file in sqlite3 table using query

I need to import csv file in sqlite3 table. I am using Visual studio (MFC applciation).
I know how to import csv using command prompt.
sqlite> .mode csv
sqlite> .import your.csv Table_Name
This is working fine. But I need to perform similar operation using some query in program.
How can I do this using query in my program?
The .import command is implemented by the sqlite3 command-line shell.
If you want to do the same in your program, you have to copy that code from the shell's source code (shell.c).

Resources