Extract BitWarden Secrets from Database

docker exec -i bitwarden-mssql sh -c 'cat > /tmp/query.sql' <<"EOF"
USE [vault];
SELECT [Id],[Name],[Email],[MasterPassword],[MasterPasswordHint],[TwoFactorProviders],[Key],[PublicKey],[PrivateKey],[Kdf],[KdfIterations] FROM [User] WHERE [Email]='${EMAIL}';
EOF
docker exec -i -e LC_ALL=C.UTF-8 -e LANG=C.UTF-8 bitwarden-mssql mssqlcli -o json query /tmp/query.sql \
  | jq '.results[]' \
  > /tmp/user_data.json

docker exec -i bitwarden-mssql sh -c 'cat > /tmp/query.sql' <<"EOF"
USE [vault];
SELECT [Cipher].[Id],[Cipher].[Data] FROM [Cipher] LEFT JOIN [User] ON ([User].[Id] = [Cipher].[UserId]) WHERE [User].[Email]='${EMAIL}';
EOF
docker exec -i -e LC_ALL=C.UTF-8 -e LANG=C.UTF-8 bitwarden-mssql mssqlcli -o json query /tmp/query.sql \
  | jq '[ .results[] | { "Data": ( .Data | fromjson ), "Id": .Id } ]' \
  > /tmp/user_ciphers.json