Skip to content

Commit

Permalink
Add .psqlrc configuration file and copy it to the Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviomartins committed Apr 24, 2024
1 parent 21d9609 commit 68bf992
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions notebook/.psqlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- Official docs: http://www.postgresql.org/docs/9.3/static/app-psql.html
-- Unofficial docs: http://robots.thoughtbot.com/improving-the-command-line-postgres-experience

-- Don't display the "helpful" message on startup.
\set QUIET 1
\pset null '[NULL]'

-- http://www.postgresql.org/docs/9.3/static/app-psql.html#APP-PSQL-PROMPTING
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# '
-- PROMPT2 is printed when the prompt expects more input, like when you type
-- SELECT * FROM<enter>. %R shows what type of input it expects.
\set PROMPT2 '[more] %R > '

-- Use best available output format
\x auto
\set VERBOSITY verbose
\set HISTFILE ~/.psql_history- :DBNAME
\set HISTCONTROL ignoredups
\set COMP_KEYWORD_CASE upper
\unset QUIET
1 change: 1 addition & 0 deletions notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ RUN pip install --quiet --no-cache-dir \

USER ${NB_UID}

COPY --chown=${NB_UID}:${NB_GID} ./.psqlrc ${HOME}/.psqlrc
COPY --chown=${NB_UID}:${NB_GID} ./.sqliterc ${HOME}/.sqliterc

WORKDIR "${HOME}"

0 comments on commit 68bf992

Please sign in to comment.