feat: add Copilot instructions for database command style and credential handling
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Copilot Instructions
|
||||
|
||||
## Database Command Style
|
||||
|
||||
When suggesting database commands in this repository, always use credentials loaded from `.env` inline in the command.
|
||||
|
||||
Required pattern:
|
||||
- Read `MARIADB_ROOT_PASSWORD` from `.env` with `grep` and sanitize quotes/CRLF.
|
||||
- Read `MARIADB_DATABASE` from `.env` with `grep` and sanitize quotes/CRLF.
|
||||
- Pass both values directly to `mariadb` command invocations.
|
||||
|
||||
Preferred one-liner style:
|
||||
|
||||
```bash
|
||||
docker exec -i recipe-db mariadb -uroot -p"$(grep -E '^[[:space:]]*MARIADB_ROOT_PASSWORD[[:space:]]*=' .env | tail -n1 | sed -E 's/^[^=]*=[[:space:]]*//; s/[[:space:]]+$//; s/^["'\''']|["'\''']$//g' | tr -d '\r')" "$(grep -E '^[[:space:]]*MARIADB_DATABASE[[:space:]]*=' .env | tail -n1 | sed -E 's/^[^=]*=[[:space:]]*//; s/[[:space:]]+$//; s/^["'\''']|["'\''']$//g' | tr -d '\r')" -e "SELECT 1;"
|
||||
```
|
||||
|
||||
Do not suggest hardcoded passwords for MariaDB commands.
|
||||
Reference in New Issue
Block a user