atuin / delete-cli-account
tag:

Delete user account

I get emails asking me to do this from time to time. I never remember which tables to clean up. Streamline it!

This is currently too awkard to do by just inserting a username. I really want to improve that, there are probably some blocks we need + SSH support to finish

 

email
golaniy@gmail.com

 

The following is a LITTLE gross. We should streamline the database block usage so it can work over ssh maybe? and read the output in templates. Or just AI integration so writing these is easier.

 

Script
get user id
bash
ssh root@pg-0 "sudo -u postgres psql atuin -tAc \"select id from users where email='{{ var.email }}'\""
user_id

 

 

Script
delete from sessions
zsh
ssh root@pg-0 "sudo -u postgres psql atuin -tAc \"delete from sessions where user_id={{ var.user_id }}\""
Script
delete from store
zsh
ssh root@pg-0 "sudo -u postgres psql atuin -tAc \"delete from store where user_id={{ var.user_id }}\""
Script
delete from history
zsh
ssh root@pg-0 'sudo -u postgres psql atuin -tAc "delete from history where user_id={{ var.user_id }}"'
Script
delete from verification
zsh
ssh root@pg-0 'sudo -u postgres psql atuin -tAc "delete from user_verification_token where user_id={{ var.user_id }}"'
Script
delete from user total history
zsh
ssh root@pg-0 "sudo -u postgres psql atuin -tAc \"delete from total_history_count_user where user_id={{ var.user_id }}\""
Script
delete from users
zsh
ssh root@pg-0 'sudo -u postgres psql atuin -tAc "delete from users where id={{ var.user_id }}"'

 

Terminal
Terminal 1
ssh root@pg-0