From 1a97f6b9ee0c236d53eebdd0ccc72f8b24cf99ff Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 10 Aug 2018 15:58:03 -0700 Subject: flask and postgres notes --- software/flask.page | 10 ++++++++++ software/postgres.page | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 software/flask.page create mode 100644 software/postgres.page diff --git a/software/flask.page b/software/flask.page new file mode 100644 index 0000000..1df6bc6 --- /dev/null +++ b/software/flask.page @@ -0,0 +1,10 @@ + +TODO: create a flask+sqlite3 template app? + +use sqlite.Row as a "row factory" to get key/value stuff + +JSON REST API? Use apispec and marshmallow; sqlalchemy ORM for persistence. + +- flask-apispec +- flask-marshmallow +- (etc) diff --git a/software/postgres.page b/software/postgres.page new file mode 100644 index 0000000..bdb01d8 --- /dev/null +++ b/software/postgres.page @@ -0,0 +1,17 @@ + +Start a quick local docker database: + + docker run -p 5432:5432 postgres:latest + +Connect (from outside): + + psql -h localhost -w postgres + +Dump current schema with something like: + + docker exec 6a018d9d8ef0 pg_dump -U postgres postgres -s | rg -v ^- > schema.sql + +Basic status from the psql command line: + + \l+ (list databases) + \dt+ (describe table) -- cgit v1.2.3