nakano16180 / pyDB

pythonでデータベース操作

Home Page:https://nakano16180.github.io/pyDB/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Database

Python setup

$ git clone https://github.com/nakano16180/pyDB.git
$ cd pyDB/
$ pipenv install

Postgresql

setup

create database

$ docker run -v /var/lib/psql --name psql_data busybox
$ docker run --volumes-from psql_data --name psql -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres:9.6
$ docker exec -it psql bash
# psql -h localhost -U postgres

postgres=# \l
postgres=# create database pydb_practice;
postgres=# \q

# exit

run

$ pipenv run pythton python_db.py

Sqlite

$ mkdir database/
$ pipenv run python sqlite_app.py

参考資料

About

pythonでデータベース操作

https://nakano16180.github.io/pyDB/


Languages

Language:Python 100.0%