Commit 3d0aa9f
Add Flow lib defs for node:sqlite (#55284)
Summary:
Pull Request resolved: #55284
This diff adds Flow type definitions for the `node:sqlite` module, Node.js's built-in SQLite database interface added experimentally in v22.5.0.
**Module Overview:**
The `node:sqlite` module provides synchronous SQLite database operations, enabling embedded database functionality without external dependencies.
**Core Classes:**
1. **DatabaseSync** - Main database interface
- `constructor(location: string, options?: DatabaseSyncOptions)`
- `exec(sql: string)` - Execute SQL without returning results
- `prepare(sql: string)` - Create prepared statement
- `close()` / `open()` - Manage connection lifecycle
- `function()` - Register custom SQL functions
- `createSession()` / `applyChangeset()` - Session/changeset support
- https://nodejs.org/api/sqlite.html#class-databasesync
2. **StatementSync** - Prepared statement interface
- `all(...params)` - Return all rows as array
- `get(...params)` - Return first row
- `run(...params)` - Execute and return changes/lastInsertRowid
- `iterate(...params)` - Return iterator over rows
- `expandedSQL` / `sourceSQL` - SQL inspection
- https://nodejs.org/api/sqlite.html#class-statementsync
3. **Session** - Change tracking interface
- `changeset()` - Get changes as Uint8Array
- `patchset()` - Get minimal changes
- `close()` - End session
**References:**
- Node.js sqlite module documentation: https://nodejs.org/api/sqlite.html
**Stability:** Experimental (added in v22.5.0)
Changelog: [Internal]
Reviewed By: GijsWeterings
Differential Revision: D90764441
fbshipit-source-id: 9bce1e13bf8d550211c62d7d5cde2558543793631 parent 534c06f commit 3d0aa9f
1 file changed
Lines changed: 122 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3348 | 3348 | | |
3349 | 3349 | | |
3350 | 3350 | | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
| 3363 | + | |
| 3364 | + | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
| 3434 | + | |
| 3435 | + | |
| 3436 | + | |
| 3437 | + | |
| 3438 | + | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
| 3447 | + | |
| 3448 | + | |
| 3449 | + | |
| 3450 | + | |
| 3451 | + | |
| 3452 | + | |
| 3453 | + | |
| 3454 | + | |
| 3455 | + | |
| 3456 | + | |
| 3457 | + | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
3351 | 3470 | | |
3352 | 3471 | | |
3353 | 3472 | | |
| |||
5042 | 5161 | | |
5043 | 5162 | | |
5044 | 5163 | | |
5045 | | - | |
| 5164 | + | |
5046 | 5165 | | |
5047 | 5166 | | |
5048 | 5167 | | |
5049 | 5168 | | |
5050 | | - | |
| 5169 | + | |
5051 | 5170 | | |
5052 | 5171 | | |
5053 | 5172 | | |
5054 | | - | |
| 5173 | + | |
5055 | 5174 | | |
5056 | 5175 | | |
5057 | 5176 | | |
| |||
0 commit comments