-
Notifications
You must be signed in to change notification settings - Fork 15
feat: add is_local() function to detect Supabase CLI environment #502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 12-05-refactor_atlas_baseline_to_use_fresh_hosted_supabase_schema
Are you sure you want to change the base?
Conversation
|
|
View your CI Pipeline Execution ↗ for commit 5166c57
☁️ Nx Cloud last updated this comment at |
e2e0542 to
62bac21
Compare
c5e9928 to
9561a5c
Compare
62bac21 to
66f7089
Compare
66f7089 to
948f79e
Compare
9561a5c to
08e5f14
Compare
948f79e to
dcf6478
Compare
08e5f14 to
6797882
Compare
- Introduced SQL function pgflow.is_local to check if running in local Supabase CLI by matching JWT secret - Updated database type definitions to include is_local method - Added migration script to create the is_local function in the database - Included tests to verify is_local behavior with matching, missing, and different JWT secrets - Updated migration tracking files to include the new is_local function
6797882 to
9ee0fa1
Compare
dcf6478 to
5166c57
Compare
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-502.pgflow.pages.dev 📝 Details:
_Last updated: _ |

Add
pgflow.is_local()function to detect local development environmentThis PR adds a new SQL function
pgflow.is_local()that detects whether the application is running in a local Supabase CLI environment by checking if the JWT secret matches the known hardcoded local value.The function:
trueonly when the JWT secret exactly matches the Supabase CLI's default valuefalsein all other cases (production environments, custom JWT secrets)falsecoalesceto handle missing configuration valuesAdded comprehensive tests to verify the function works correctly in different scenarios:
This utility will help implement environment-specific behaviors without requiring explicit configuration.