-
Notifications
You must be signed in to change notification settings - Fork 459
feat: add deprecation messaging for legacy Netlify DB extension #8141
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
Changes from all commits
1bde506
28bd588
5303f59
704a7b6
77f1b84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -76,4 +76,15 @@ export const status = async (_options: OptionValues, command: BaseCommand) => { | |||||
| unpooledDatabaseUrlEnv?.key === 'NETLIFY_DATABASE_URL_UNPOOLED' ? 'saved' : chalk.red('not set'), | ||||||
| }), | ||||||
| ) | ||||||
|
|
||||||
| // Show deprecation warning if a legacy extension DB is detected | ||||||
| if (process.env.EXPERIMENTAL_NETLIFY_DB_ENABLED === '1' && databaseUrlEnv?.key === 'NETLIFY_DATABASE_URL') { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deprecation warning guard is unreachable in the current command wiring.
Suggested fix- if (process.env.EXPERIMENTAL_NETLIFY_DB_ENABLED === '1' && databaseUrlEnv?.key === 'NETLIFY_DATABASE_URL') {
+ if (databaseUrlEnv?.key === 'NETLIFY_DATABASE_URL') {π Committable suggestion
Suggested change
π€ Prompt for AI Agents |
||||||
| log() | ||||||
| log( | ||||||
| chalk.yellow( | ||||||
| 'Warning: This site has a database from the legacy Netlify DB extension, which has been deprecated. Netlify Database is now available as a built-in feature.', | ||||||
| ), | ||||||
| ) | ||||||
| log(`For migration instructions, visit ${chalk.cyan('https://ntl.fyi/db-migration')}`) | ||||||
| } | ||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
π Web query:
What is the current official npm package and install command for Netlify Database in Netlify CLI docs:@netlify/dbor@netlify/database?π‘ Result:
There is no separate official npm package like
@netlify/dbor@netlify/databaserequired for Netlify Database in the Netlify CLI docs. Netlify Database functionality is built into the Netlify CLI itself (npm package: netlify-cli), which provides the netlify db commands such as netlify db init and netlify db status for provisioning and managing the database. For local development, use npx netlify db init (which runs the latest netlify-cli without global install). Install Netlify CLI with npm install netlify-cli -g or npm install --save-dev netlify-cli for projects/CI. Optionally, for automatic database provisioning during builds, install@netlify/neonin your project: npm install@netlify/neon. This is not the core CLI package and was mentioned in beta docs; Netlify DB uses Neon Postgres under the hood.Citations:
Replace the deprecated
@netlify/databasepackage with correct instructions.The deprecation message directs users to install
@netlify/database, but this package does not exist. According to official Netlify docs, the correct package for automatic database provisioning is@netlify/neon. Update lines 115β116 to install the correct package:Alternatively, if the intent is to simply inform users that the
netlify db initcommand is deprecated without requiring a separate package installation (since Netlify Database is built into netlify-cli), adjust the message accordingly.π€ Prompt for AI Agents