From 0aa82db3616e35d0d8bb817d1eeb836238611b63 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Fri, 16 Oct 2026 08:13:57 -0400 Subject: [PATCH] populate Docker history file with examples a user need only press up-arrow to run example queries, and fuzzy history search does something meaningful. --- changelog.md | 5 +++++ docker/Dockerfile | 1 + docker/resources/dot_mycli_history.txt | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 docker/resources/dot_mycli_history.txt diff --git a/changelog.md b/changelog.md index fe81d791..47e2520e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,11 @@ Upcoming (TBD) ============== +Features +-------- +* Populate history file in Docker with examples. + + Bug Fixes -------- * Show the username in the Docker prompt. diff --git a/docker/Dockerfile b/docker/Dockerfile index 85e5d43a..f10bd0ba 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,6 +13,7 @@ RUN apt-get update -qq && \ rm -rf /var/lib/{apt,dpkg,cache,log}/ COPY . /app +COPY docker/resources/dot_mycli_history.txt /root/.mycli-history RUN service mariadb restart && \ cd /app/docker/resources && \ diff --git a/docker/resources/dot_mycli_history.txt b/docker/resources/dot_mycli_history.txt new file mode 100644 index 00000000..0b14cec4 --- /dev/null +++ b/docker/resources/dot_mycli_history.txt @@ -0,0 +1,26 @@ +# 2026-10-08 07:35:11.242332 ++SELECT MAX(salary) AS current_salary FROM salaries GROUP BY emp_no .| df['current_salary'].plot.hist(); + +# 2026-10-09 07:35:11.242332 ++SELECT * FROM salaries .| df.group_by('emp_no').len(name='num_raises').with_columns(pl.col('num_raises') - 1); + +# 2026-10-10 07:35:11.242332 ++SELECT * FROM salaries LIMIT 10000 .| df.describe(); + +# 2026-10-11 07:35:11.242332 ++SELECT employees.first_name, employees.last_name, MAX(salary) AS current_salary FROM salaries JOIN employees ON salaries.emp_no = employees.emp_no GROUP BY salaries.emp_no; + +# 2026-10-12 07:35:11.242332 ++SELECT salaries.emp_no, MAX(salary) AS current_salary FROM salaries JOIN employees ON salaries.emp_no = employees.emp_no GROUP BY salaries.emp_no; + +# 2026-10-13 07:35:11.242332 ++DESCRIBE employees; + +# 2026-10-14 07:35:11.242332 ++SELECT emp_no, MAX(salary) AS current_salary FROM salaries GROUP BY emp_no; + +# 2026-10-15 07:35:11.242332 ++SELECT emp_no, salary FROM salaries LIMIT 1000; + +# 2026-10-16 07:35:11.242332 ++DESCRIBE salaries;