Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SqlStatement
✓ import { SqlStatement } from 'remix/data-table';
This import path is for the upcoming Remix v3 (e.g., remix@3.0.0-alpha.4). Stable Remix 2.x typically imports from '@remix-run/node' or '@remix-run/react'.
This example demonstrates defining a SQL statement using the `SqlStatement` and `sql` template literal tag from `remix/data-table`. This API is part of the new data layer introduced in Remix v3, allowing for type-safe SQL query construction.
import { SqlStatement, sql } from 'remix/data-table';
interface User {
id: string;
name: string;
}
async function getUsersQuery(nameFilter?: string): Promise<SqlStatement<User[]>> {
let query = sql`SELECT id, name FROM users`;
if (nameFilter) {
query = sql`${query} WHERE name = ${nameFilter}`;
}
return query as SqlStatement<User[]>;
}
async function runExample() {
// In a real app, this would be executed by a Database adapter.
const statement = await getUsersQuery('Alice');
console.log('Generated SQL:', statement.sql);
console.log('Parameters:', statement.params);
}
runExample();
Debug
Known issues
breakingSession state access has changed from `context.session` to `context.get(Session)`.fixReplace direct access to `context.session` with `context.get(Session)` for session data.
affects: session-middleware@>=0.2.0
breakingParsed form data is no longer available via `context.formData` or `context.files`. It must be accessed via `context.get(FormData)`.fixUpdate your code to use `context.get(FormData)` to retrieve parsed form data and uploaded files.
affects: form-data-middleware@>=0.2.0
breakingAction object definitions (e.g., in `router.get`, `router.post`) now require the property `handler` instead of `action` for specifying the handler function.fixRename the `action` property to `handler` in your action object definitions.
affects: fetch-router@>=0.18.0
breakingThe `remix/data-table/sql` export has been removed. `SqlStatement`, `sql`, and `rawSql` must now be imported directly from `remix/data-table`.fixChange import statements from `remix/data-table/sql` to `remix/data-table`.
affects: remix@3.0.0-alpha.4
gotcha`parseMultipart()`, `parseMultipartStream()`, and `parseMultipartRequest()` now enforce finite default `maxParts` and `maxTotalSize` limits, potentially causing `MaxPartsExceededError` or `MaxTotalSizeExceededError` for large requests.fixFor large multipart requests, explicitly raise the `maxParts` or `maxTotalSize` limits when calling the parsing functions.
affects: multipart-parser@>=0.15.0, form-data-parser@>=0.16.0
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'session')
Attempting to access `context.session` after `session-middleware` was updated.
fixUpdate your code to access session state using `context.get(Session)` instead of `context.session`.
TypeError: Cannot read properties of undefined (reading 'formData')
Attempting to access `context.formData` or `context.files` after `form-data-middleware` was updated.
fixUpdate your code to access parsed form data using `context.get(FormData)` instead of `context.formData` or `context.files`.
Module not found: Error: Can't resolve 'remix/data-table/sql'
Importing `SqlStatement`, `sql`, or `rawSql` from the deprecated `remix/data-table/sql` path in Remix v3.
fixChange your import statement to `import { SqlStatement, sql } from 'remix/data-table';`. Property 'action' does not exist on type 'BuildAction'. Did you mean 'handler'?
Using `action` property instead of `handler` in an action object definition after `fetch-router` update.
fixRename the `action` property to `handler` in your action object definitions (e.g., `router.get({ handler: ... })`). MaxPartsExceededError: Maximum number of parts exceeded
A multipart request exceeded the default `maxParts` limit set by `multipart-parser` or `form-data-parser`.
fixIncrease the `maxParts` option in the `parseMultipart()` or `parseFormData()` call if you expect larger requests, e.g., `parseMultipart(request, { maxParts: 1000 })`. Audit
Dependencies
No dependency data recorded yet.