Hi there,
first of all, thanks for this wonderfull app.
i'm facing an "issue". or missing something.
i want a stock portfolio. dynamic.
i can generate a csv, and import it. looks like this.
https://imgur.com/a/8Csm2wb
but it's static. i can cron the script each hour to create a new csv with updated values.
but, i have to import the csv each time. not really dynamic.
as i'm total noob, i asked copilot and chat gpt.
they talked about import the csv into postgres. but, what's now?
how can i read this table and link it from the appflowy app?
here is what copilot told me:
`#!/bin/bash
Variables
CSV_PATH="/home/me/stock_prices.csv"
CONTAINER_NAME="appflowy-cloud-postgres-1"
DB_NAME="appflowy"
DB_USER="dbusername"
Copier le fichier CSV dans le conteneur PostgreSQL
docker cp $CSV_PATH $CONTAINER_NAME:/home/stock_prices.csv
Exécuter les commandes SQL dans le conteneur PostgreSQL
docker exec -it $CONTAINER_NAME psql -U $DB_USER -d $DB_NAME -c "
DROP TABLE IF EXISTS tmp_investments;
CREATE TEMP TABLE tmp_investments (
ticker VARCHAR,
prix_achat NUMERIC,
quantite NUMERIC,
prix_actuel NUMERIC,
valeur_totale NUMERIC,
variation NUMERIC
);
COPY tmp_investments FROM '/home/stock_prices.csv' WITH (FORMAT csv, HEADER true);
UPDATE investments
SET prix_achat = tmp.prix_achat, quantite = tmp.quantite
FROM tmp_investments tmp
WHERE investments.ticker = tmp.ticker;
DROP TABLE tmp_investments;
"
`
i dont see where in the app i can link this.
and, the final copilot answer is "import the generated csv into the appflowy application".
so, all this for nothing. as my first script would generete the csv.
any clue? is this even feasible?
thanks fellows!
Hi there,
first of all, thanks for this wonderfull app.
i'm facing an "issue". or missing something.
i want a stock portfolio. dynamic.
i can generate a csv, and import it. looks like this.
https://imgur.com/a/8Csm2wb
but it's static. i can cron the script each hour to create a new csv with updated values.
but, i have to import the csv each time. not really dynamic.
as i'm total noob, i asked copilot and chat gpt.
they talked about import the csv into postgres. but, what's now?
how can i read this table and link it from the appflowy app?
here is what copilot told me:
`#!/bin/bash
Variables
CSV_PATH="/home/me/stock_prices.csv"
CONTAINER_NAME="appflowy-cloud-postgres-1"
DB_NAME="appflowy"
DB_USER="dbusername"
Copier le fichier CSV dans le conteneur PostgreSQL
docker cp $CSV_PATH $CONTAINER_NAME:/home/stock_prices.csv
Exécuter les commandes SQL dans le conteneur PostgreSQL
docker exec -it $CONTAINER_NAME psql -U $DB_USER -d $DB_NAME -c "
DROP TABLE IF EXISTS tmp_investments;
CREATE TEMP TABLE tmp_investments (
ticker VARCHAR,
prix_achat NUMERIC,
quantite NUMERIC,
prix_actuel NUMERIC,
valeur_totale NUMERIC,
variation NUMERIC
);
COPY tmp_investments FROM '/home/stock_prices.csv' WITH (FORMAT csv, HEADER true);
UPDATE investments
SET prix_achat = tmp.prix_achat, quantite = tmp.quantite
FROM tmp_investments tmp
WHERE investments.ticker = tmp.ticker;
DROP TABLE tmp_investments;
"
`
i dont see where in the app i can link this.
and, the final copilot answer is "import the generated csv into the appflowy application".
so, all this for nothing. as my first script would generete the csv.
any clue? is this even feasible?
thanks fellows!