The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Store Rust Diesel Database Passwords In macOS Keychain Access

TODO: Pull subtitle into page object
Code
diesel \
--database-url \
$(security find-generic-password -w -a alan -s password-name) \
migration \
run

Notes

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Store Rust Diesel Database Passwords In macOS Keychain Access

I don't like storing password in plain-text. That means no _.env__ files. 
Instead I use password managers to store them and call them from there 
as needed. The _diesel__ Rust crate provides a `--database-url`` argument
that serves this purpose. It's a little long to write so I make a little
script file called _migrate.bash__ with this it in:

-- code
-- shell
-- name: migrate.bash

diesel \
--database-url \
$(security find-generic-password -w -a alan -s password-name) \
migration \
run

-- notes

- The is the approach I use with macOS Keychain Access app. It's
what the `security`` command talks to. Similar command line tools
exist for other password managers

- The file needs to be made executable with:

`chmod u+x migrate.bash``

- The `-a alan`` in the example is for my account on the mac. 
You might not need it. Or, if the account is different you'll
have to change it explicitly



-- categories
-- Diesel 
-- Rust  
-- Security 
-- MySQL 
-- Postgres 
-- Command Line 

-- metadata
-- date: 2023-05-23 12:45:55
-- id: 2qcb91vu
-- site: aws
-- type: post
-- status: published