A Next.js build can succeed without connecting to a database, but that alone does not mean the finished app contains no database-backed content. Static generation can query a database while next build runs; moving a query to request-time rendering shifts the database requirement to the deployed server and changes freshness, caching, and request behavior.
What “database-free build” means
The phrase can describe two different outcomes: the build does not need a live database connection, or no database-backed content is included in the generated output. The first does not guarantee the second. If Next.js reads database records to prerender pages during the build, the build still depends on the database even if the deployed app later queries it again.
To determine what a particular project does, inspect code that runs during configuration, route discovery, static data fetching, module initialization, and prerendering. The key question is whether any of those paths opens a connection or runs a query—not simply whether the project imports a database library.
Where database access happens
Pages Router: static generation can query during the build
In the Pages Router, getStaticProps fetches data for a page at build time. For dynamic routes, getStaticPaths can obtain the paths to prerender, and getStaticProps can fetch content for each path. If either function uses a database, next build needs access to that database. See the Next.js getStaticProps guide and the getStaticPaths guide.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problems#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
App Router: prerendering can run database queries
In the App Router, a synchronous database-driver query may execute while a route is being prerendered. If the query must wait until a request arrives, call connection() before the query to opt that work out of prerendering. The connection() reference describes this behavior, including its applicability to synchronous database drivers.
Request-time rendering can also be triggered by request-specific APIs such as cookies and headers. Use the version-specific documentation for the project’s installed Next.js release: the current connection() reference is dated June 25, 2026, and notes that the API was stabilized in Next.js v15.0.0.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Build-time versus request-time database access
| Decision point | Static generation | Request-time rendering |
|---|---|---|
| When data is read | During next build for pages being prerendered. |
After deployment, as part of handling a request. |
| Where database access is required | The build environment must be able to reach the database if prerendering queries it. | The deployed runtime must be able to reach the database and have valid server-side credentials. |
| When updates appear | New records do not automatically change HTML already generated for the build. Updates require a rebuild or a supported revalidation or update approach. | A request-time query can reflect current database state, subject to the route’s caching behavior. |
| Request path | Generated HTML can be reused for requests, avoiding a database read for each served copy of that HTML. | The database is part of the live request path when the rendered response runs the query. |
| Caching | Fully prerendered output can be publicly cacheable, including by a CDN. | Dynamic output is private and non-cacheable by default in Next.js, though deployment configuration and route behavior matter. |
| Request-specific inputs | Best suited to content that can be prepared ahead of a request. | Useful when rendering depends on incoming request data or content that needs to be read at request time. |
These are general consequences of the rendering choices, not a guarantee about every deployed route. Check the route’s actual output, cache directives, and hosting configuration. Next.js explains its default caching behavior in the self-hosting guide.
What changes when a query moves to runtime
Moving a query out of prerendering can remove the need for database access during the build. It does not remove the database dependency from the application: the deployed server now needs network access to the database and valid credentials. The route also depends on the database while serving requests, so availability, query failures, and response latency become live-runtime concerns.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Runtime rendering can let one built artifact be promoted across environments that use different server-side configuration, because those values can be read by the running server. Next.js states in its environment variables guide that it supports both build-time and runtime environment variables.
Environment variables: server secrets and build-captured values
Non-prefixed environment variables are server-only and can be evaluated during dynamic rendering. Keep database credentials in server-only variables; never put them in a NEXT_PUBLIC_ variable. Statically referenced NEXT_PUBLIC_ values are inlined into browser JavaScript during next build, so promoting the built artifact to another environment does not change those inlined values. Consult the environment guide for behavior applicable to the project’s version and router.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Freshness, caching, and self-hosting
Static output offers an artifact that can be served repeatedly and cached, but it represents the data available when it was generated unless the application rebuilds or uses a supported update mechanism. Request-time output can read newer data, but it makes database work part of serving the request. The choice is therefore not simply “static or dynamic”: weigh how current the data must be, whether a route needs request-specific inputs, database load and latency, and the cache and invalidation strategy.
For self-hosted deployments, Next.js documents a filesystem-backed server cache by default. Multiple instances, ephemeral compute, or a CDN or reverse proxy may require cache coordination or durable storage, particularly when revalidation or cached data is involved. See the self-hosting guide and confirm how the actual deployment handles cache state.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
How to check a project
- Identify the router and installed Next.js version. Pages Router and App Router use different mechanisms, and behavior should be checked against documentation for the installed version.
- Find build-time execution paths. In the Pages Router, inspect
getStaticPropsandgetStaticPaths. In either router, look for data access performed during route discovery, configuration, initialization, or prerendering. - Inspect App Router query boundaries. For synchronous database queries intended to run only after a request arrives, verify that
connection()is called before the query where appropriate. - Check environment-variable usage. Confirm that database credentials are server-only and that no value requiring environment-specific runtime changes is exposed through
NEXT_PUBLIC_. - Verify output and deployment behavior. Check which routes are prerendered or dynamically rendered, their cache directives, and whether the deployed runtime can reach the database. Do not infer runtime behavior from a successful build alone.
Documentation scope and dates
The relevant official references cover both routers: the Pages Router static-generation and environment-variable guides, and the current App Router connection() and self-hosting documentation. The environment guide is dated March 16, 2026; the self-hosting guide is dated August 25, 2026; and the connection() reference is dated June 25, 2026. Consult the docs for the project’s installed version before applying these details.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

