diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-08-10 15:58:03 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-08-10 16:06:46 -0700 |
commit | 1a97f6b9ee0c236d53eebdd0ccc72f8b24cf99ff (patch) | |
tree | 39ea591a3d6e58f427675e59e274d8a6b4f37b86 | |
parent | 22c4f271e8d3f9d9e8b377838d885e4f65c7e356 (diff) | |
download | knowledge-1a97f6b9ee0c236d53eebdd0ccc72f8b24cf99ff.tar.gz knowledge-1a97f6b9ee0c236d53eebdd0ccc72f8b24cf99ff.zip |
flask and postgres notes
-rw-r--r-- | software/flask.page | 10 | ||||
-rw-r--r-- | software/postgres.page | 17 |
2 files changed, 27 insertions, 0 deletions
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) |