Skip to content

Add support for single-quoted multiline values in env loader#3

Merged
pstaylor-patrick merged 2 commits into
mainfrom
baguette-mvp
Feb 9, 2026
Merged

Add support for single-quoted multiline values in env loader#3
pstaylor-patrick merged 2 commits into
mainfrom
baguette-mvp

Conversation

@pstaylor-patrick

@pstaylor-patrick pstaylor-patrick commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

related to #1

👋 TL;DR

Removed unused schema generation code and writeFileSync import from db-pull-dump.ts, and added support for single-quoted multiline values in firebase-env.sh.

🔎 Details

The changes consist of two main parts:

  1. Database Script Cleanup: Removed unused writeFileSync import and the entire generateSchemaSql function with its helper getColumnType from db-pull-dump.ts since they were no longer being used. This includes:

    • Schema enumeration and creation logic
    • Table structure generation with column definitions
    • Primary key constraint extraction
    • Index generation
    • Type mapping utilities
  2. Shell Script Enhancement: Enhanced firebase-env.sh to properly handle multiline environment variables that use single quotes (') in addition to the existing double quote (") support. The fix adds:

    • Detection of single-quoted values at the start of a line
    • Proper termination when encountering a closing single quote
    • Consistent export behavior for single-quoted multiline values

✅ How to Test

  1. Database Script:

    • Verify the script still runs without errors after removing the unused import and functions
    • Confirm the remaining escapeCopyValue function works correctly
    • Run the script to ensure it connects to the database and performs its core functionality
  2. Shell Script:

    • Test with environment files containing multiline values using single quotes
    • Test with environment files containing multiline values using double quotes (regression test)
    • Verify that both single and double-quoted values are parsed correctly
    • Test with mixed content to ensure the parsing logic doesn't break existing functionality

🥜 GIF

lack-of-hustle

@pstaylor-patrick pstaylor-patrick marked this pull request as ready for review February 9, 2026 14:13
@pstaylor-patrick pstaylor-patrick merged commit 29e0603 into main Feb 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant