HI there, i have done using node-fetch to get data from api url, however i am having problem in sending data to postgresql, i am thinking using node-postgres to send data, but i not so familiar, can you suggest any other ways? Thank you.
- 9 replies
For sending data to the PostgresSQL, please refer to the source code mqtt-postgres-k8s in the level 2 training course.
- In reply tomarc_lin⬆:
hi sir, i have tried with the method you gave, with the credential key also, i able to get the data view using ingress url, but the table is missing when i want to make dashboard. i am using the code to create table.
CREATE SCHEMA "final_projects"; ALTER SCHEMA "final_projects" OWNER TO "g_final_project"; CREATE TABLE IF NOT EXISTS "final_projects"."temperature_souwei_tan"( id serial, timestamp timestamp without time zone NOT NULL DEFAULT (current_timestamp AT TIME ZONE 'UTC+0'), temperature integer, PRIMARY KEY (id) ); ALTER TABLE "final_projects"."temperature_souwei_tan" OWNER to "g_final_project"; GRANT ALL ON ALL TABLES IN SCHEMA "final_projects" TO "g_final_project"; GRANT ALL ON ALL SEQUENCES IN SCHEMA "final_projects" TO "g_final_project";;
Please provide more information about your situation and print-screen.
I try to find the temperature_souwei_tan but its not there for selection. i check with the url of mine, and it is fine and responded 200 ok. I am sorry for not so good at it. Thank you
You might implement previous course unit of Level 2 then do the final project.
Please try to use the same method in the previous course unit to check the table in the Postgresql by PGadmin first.
hi sir, as mentioned by you, i able to create table and the timezone i set with timezone, but i did not showed value in dashboard.
is my coding wrong? i use the time zone code as below
timestamp timestamp with time zone
default (TIMESTAMP '2020-03-17 09:00:00' AT TIME ZONE 'JST')
How do you confirm the table you constructed?
Have you made sure the table you built in the Progressql by the PGadmin as I mentioned before?
If yes, try to check the data source setting of the table you use in the Dashboard.
Hi sir, this is how i observed that i have create my table in postgresql. sorry if i did not show clear info to you. ok i will check the dashboard setting. thanks
Our final-project-demo architecture is to connect the local data to the wise-paas (external cloud) , so the host needs to use external host, you can view postgresql secret in portal-service and find the external host .
host：Internal connection for use
External host：External connection for use