S
S
SteamEmix2019-01-22 20:44:07
PostgreSQL
SteamEmix, 2019-01-22 20:44:07

How to write data to Docker database?

Hello everyone, the question is, you need to write a script in python that will write something to the database once in a while, while the database is sitting in the docker, how to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rail Khamitov, 2019-01-22
@SteamEmix

Is the problem in writing code or is the base in the docker?
Does your docker container expose the base port outside? If it's Postgres, then by default it should be port 5432.
If it does, then consider that you have the most common local database. Calmly connect to it with the help of a python and write what you need
. For example, like here. www.postgresqltutorial.com/postgresql-python/insert

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question