@chidchanun/bcp 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/README.md CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  The `docs/` directory is the documentation source of truth for BCP Framework and is organized for **`bcp-docs-web`**.
4
4
 
5
- > **Documentation target:** BCP Framework `0.2.1`
5
+ > **Documentation target:** BCP Framework `0.2.2`
6
6
  >
7
- > **Release state:** unreleased development target. Do not label `0.2.1` as published until RC validation, tagging and npm publication complete.
7
+ > **Release state:** unreleased development target. Do not label `0.2.2` as published until RC validation, tagging and npm publication complete.
8
8
 
9
- ## Documentation architecture — 0.2.1
9
+ ## Documentation architecture
10
10
 
11
11
  BCP uses three machine-readable documentation contracts:
12
12
 
@@ -41,20 +41,31 @@ manifest-driven sync
41
41
 
42
42
  Framework source and tests remain authoritative for runtime behavior.
43
43
 
44
- ## Documentation Platform
44
+ ## 0.2.2 — Configuration & Environment v2
45
45
 
46
- `0.2.1` adds a versioned contract between the framework repository and the documentation website.
46
+ `0.2.2` adds an optional typed application environment schema while preserving the established framework configuration precedence.
47
47
 
48
- New sources:
48
+ New/updated documentation sources:
49
49
 
50
50
  | Source | Purpose |
51
51
  | --- | --- |
52
- | `api-manifest.json` | Public API entrypoint metadata |
53
- | `api-reference.md` | Human-readable public package entrypoint reference |
54
- | `documentation-platform.md` | Docs-web synchronization/versioning contract |
55
- | `releases/0.2.1.md` | Documentation Platform release notes |
52
+ | `environment-validation.md` | `bcp.environment.*`, validation rules, CLI checks and secret/public boundaries |
53
+ | `configuration.md` | Framework configuration precedence and diagnostics workflow |
54
+ | `platform-manifest.json` | Declares typed environment/config diagnostics capabilities |
55
+ | `api-manifest.json` | Maps `bcp/config` to configuration and environment guides |
56
+ | `releases/0.2.2.md` | Configuration & Environment v2 release notes |
56
57
 
57
- The website should not maintain a second hard-coded list of framework pages when those pages exist in `docs-web-manifest.json`.
58
+ Primary command:
59
+
60
+ ```bash
61
+ bcp config check
62
+ ```
63
+
64
+ JSON diagnostics:
65
+
66
+ ```bash
67
+ bcp config check --json
68
+ ```
58
69
 
59
70
  ## Update rule
60
71
 
@@ -64,14 +75,14 @@ When framework behavior or public surface changes:
64
75
  2. Add/update regression tests.
65
76
  3. Update the matching Markdown guide.
66
77
  4. Update `platform-manifest.json` when runtime/public-entrypoint/capability metadata changes.
67
- 5. Update `api-manifest.json` when public API entrypoint ownership changes.
78
+ 5. Update `api-manifest.json` when public API ownership/guide mapping changes.
68
79
  6. Update `docs-web-manifest.json` when website routes/navigation change.
69
80
  7. Update `docs/releases/<version>.md`.
70
81
  8. Change release state only after the release workflow reaches that state.
71
82
 
72
83
  ## Docs-web navigation
73
84
 
74
- `docs/docs-web-manifest.json` is the ordered navigation contract.
85
+ `docs/docs-web-manifest.json` is the authoritative ordered navigation contract.
75
86
 
76
87
  Current sections:
77
88
 
@@ -88,46 +99,104 @@ API Reference
88
99
  Releases
89
100
  ```
90
101
 
91
- Important `0.2.1` routes:
102
+ Important current routes:
92
103
 
93
104
  | Website route | Markdown source |
94
105
  | --- | --- |
106
+ | `/docs/configuration` | `configuration.md` |
107
+ | `/docs/environment-validation` | `environment-validation.md` |
95
108
  | `/docs/platform-contract` | `platform-contract.md` |
96
109
  | `/docs/documentation-platform` | `documentation-platform.md` |
97
110
  | `/docs/migration-0.2` | `migration-0.2.md` |
98
111
  | `/docs/api-reference` | `api-reference.md` |
99
- | `/releases/0.2.1` | `releases/0.2.1.md` |
112
+ | `/releases/0.2.2` | `releases/0.2.2.md` |
100
113
 
101
114
  Every route/source pair is validated by unit tests.
102
115
 
116
+ ## Configuration source model
117
+
118
+ Framework settings:
119
+
120
+ ```text
121
+ bcp.config.ts
122
+ bcp.config.mts
123
+ bcp.config.js
124
+ bcp.config.mjs
125
+ ```
126
+
127
+ Application environment schema:
128
+
129
+ ```text
130
+ bcp.environment.ts
131
+ bcp.environment.mts
132
+ bcp.environment.js
133
+ bcp.environment.mjs
134
+ ```
135
+
136
+ Only one file from each convention may exist at a time.
137
+
138
+ The environment schema is optional. Existing applications without `bcp.environment.*` continue to use the previous environment-loading behavior.
139
+
140
+ Configuration precedence remains:
141
+
142
+ ```text
143
+ CLI override
144
+
145
+ BCP_* environment
146
+
147
+ bcp.config.*
148
+
149
+ framework defaults
150
+ ```
151
+
152
+ See [Environment Validation](environment-validation.md).
153
+
154
+ ## Environment security boundary
155
+
156
+ `BCP_PUBLIC_*` values may be embedded into browser bundles. They must never contain credentials/private secrets.
157
+
158
+ A variable declared with:
159
+
160
+ ```ts
161
+ secret: true
162
+ ```
163
+
164
+ must not use the `BCP_PUBLIC_` prefix. The configuration validator treats that combination as an error.
165
+
166
+ `secret: true` is validation/tooling metadata and does not encrypt a value.
167
+
103
168
  ## Platform manifest
104
169
 
105
- `docs/platform-manifest.json` describes the supported framework baseline:
170
+ `docs/platform-manifest.json` describes the supported framework baseline, including:
106
171
 
107
172
  ```text
108
- schema version
109
173
  framework version/release state
110
174
  Node/React/runtime baseline
111
175
  production build target
112
176
  public package entrypoints
113
177
  CLI command families
114
- capabilities
115
- storage-provider families
116
- previous baseline compatibility intent
178
+ capability flags
179
+ previous-baseline compatibility intent
117
180
  documentation contract files
118
181
  ```
119
182
 
120
- Supported production target remains:
183
+ `0.2.2` declares the additional capabilities:
121
184
 
122
185
  ```text
123
- standalone-node
186
+ typedEnvironmentSchema
187
+ configurationDiagnostics
188
+ configCheckCli
124
189
  ```
125
190
 
126
- Native executable, desktop and mobile compilation remain future roadmap work.
191
+ The supported production target remains:
192
+
193
+ ```text
194
+ standalone-node
195
+ ```
127
196
 
128
197
  ## API manifest
129
198
 
130
- `docs/api-manifest.json` describes the public package entrypoints that documentation tooling may present as supported API surfaces.
199
+ `docs/api-manifest.json` describes the public package entrypoints documentation tooling may present as supported API surfaces.
131
200
 
132
201
  Current entrypoints:
133
202
 
@@ -145,24 +214,18 @@ bcp/server-only
145
214
  bcp/middleware
146
215
  ```
147
216
 
148
- Each API entry records:
217
+ `bcp/config` owns both:
149
218
 
150
219
  ```text
151
- package
152
- source file
153
- environment boundary
154
- reference route
155
- summary
156
- related guide routes
220
+ /docs/configuration
221
+ /docs/environment-validation
157
222
  ```
158
223
 
159
- The API-manifest entrypoint set must match the public-entrypoint set in `platform-manifest.json` exactly.
160
-
161
- See [API Reference](api-reference.md).
224
+ The API-manifest entrypoint set must match the platform public-entrypoint set exactly.
162
225
 
163
226
  ## bcp-docs-web synchronization
164
227
 
165
- The `bcp-docs-web` sync should load all three manifests first.
228
+ The docs website sync loads the manifests before Markdown content:
166
229
 
167
230
  ```text
168
231
  selected framework ref
@@ -173,41 +236,19 @@ api-manifest.json
173
236
 
174
237
  validate version/release/API parity
175
238
 
176
- load only referenced Markdown
177
-
178
- rewrite internal Markdown links to website routes
239
+ load referenced Markdown
179
240
 
180
241
  synchronize CMS/search/navigation
181
242
  ```
182
243
 
183
- The matching docs-web implementation supports local framework source or a selected Git ref.
184
-
185
- Examples:
244
+ Examples from the docs-web project:
186
245
 
187
246
  ```powershell
188
247
  npm run docs:sync -- --dry-run
189
248
  npm run docs:sync -- --publish-new
190
- npm run docs:sync -- --ref=v0.2.0
249
+ npm run docs:sync -- --ref=v0.2.1
191
250
  ```
192
251
 
193
- Using a tag/ref is the foundation for historical/versioned documentation without manually copying current Markdown into another source tree.
194
-
195
- ## Public API guide ownership
196
-
197
- | Entrypoint | Primary guides |
198
- | --- | --- |
199
- | `bcp` | `routing.md`, `server-data-loaders.md`, `route-guards.md`, `form-actions.md` |
200
- | `bcp/island` | `hydration.md` |
201
- | `bcp/cache` | `caching.md` |
202
- | `bcp/config` | `configuration.md` |
203
- | `bcp/validation` | `validation.md` |
204
- | `bcp/error` | `error-handling.md` |
205
- | `bcp/database` | `database.md`, `database-migrations.md` |
206
- | `bcp/auth` | `authentication.md`, `auth-route-guards.md`, `session-auth.md` |
207
- | `bcp/server` | `server-request-apis.md`, `file-upload.md`, `storage.md`, `storage-ecosystem.md`, `production-hardening.md` |
208
- | `bcp/server-only` | `application-modules.md` |
209
- | `bcp/middleware` | `middleware.md` |
210
-
211
252
  ## Source conventions
212
253
 
213
254
  - one H1 per Markdown page,
@@ -220,15 +261,9 @@ Using a tag/ref is the foundation for historical/versioned documentation without
220
261
  - no framework-internal module presented as public API,
221
262
  - no secrets/runtime `.env` values in public documentation metadata.
222
263
 
223
- ## Search and previous/next
224
-
225
- Search should index Markdown content and headings. Manifest titles/categories/API summaries may be used as metadata.
226
-
227
- Sidebar and previous/next ordering should follow `docs-web-manifest.json` order so navigation surfaces cannot drift from each other.
228
-
229
264
  ## Release validation
230
265
 
231
- Before publishing `0.2.1`:
266
+ Before publishing `0.2.2`:
232
267
 
233
268
  ```bash
234
269
  npm run typecheck
@@ -239,14 +274,17 @@ npm run test:e2e
239
274
  npm run rc:check
240
275
  ```
241
276
 
242
- Documentation Platform validation covers:
277
+ Configuration & Environment v2 validation covers:
243
278
 
244
- - every Markdown source exists,
245
- - every docs/release route is unique,
246
- - package/platform/docs/API versions match,
247
- - API entrypoints match the platform public-entrypoint set,
248
- - API guide routes exist,
249
- - prepared npm packages contain the three manifests, API reference and Documentation Platform guide.
279
+ - typed environment rules/defaults,
280
+ - project `bcp.environment.*` loading,
281
+ - public/secret safety boundary,
282
+ - production diagnostics,
283
+ - `bcp config check` CLI parsing,
284
+ - dev schema watching,
285
+ - public `bcp/config` exports,
286
+ - prepared npm package files,
287
+ - docs/platform/API version parity.
250
288
 
251
289
  The final release tag must point to the exact commit that passed the complete RC sequence.
252
290
 
@@ -272,12 +310,13 @@ release notes
272
310
  Planned next milestone:
273
311
 
274
312
  ```text
275
- 0.2.2Configuration & Environment v2
313
+ 0.2.3Database Platform v2
276
314
  ```
277
315
 
278
316
  Focus:
279
317
 
280
- - typed production configuration improvements,
281
- - environment validation,
282
- - startup configuration diagnostics,
283
- - configuration schema/inspection tooling.
318
+ - database adapter contract,
319
+ - PostgreSQL support,
320
+ - SQLite support,
321
+ - connection lifecycle improvements,
322
+ - provider-consistent migration workflows.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "framework": "bcp",
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "releaseState": "unreleased",
6
6
  "coverage": "public-entrypoints",
7
7
  "entrypoints": [
@@ -43,9 +43,10 @@
43
43
  "source": "packages/client/src/config.ts",
44
44
  "environment": "server",
45
45
  "route": "/docs/api-reference#bcp-config",
46
- "summary": "Typed BCP configuration definition, loading and resolution APIs.",
46
+ "summary": "Typed BCP configuration, environment-schema validation and configuration diagnostics APIs.",
47
47
  "guides": [
48
- "/docs/configuration"
48
+ "/docs/configuration",
49
+ "/docs/environment-validation"
49
50
  ]
50
51
  },
51
52
  {
@@ -73,7 +74,7 @@
73
74
  "source": "packages/client/src/database.ts",
74
75
  "environment": "server",
75
76
  "route": "/docs/api-reference#bcp-database",
76
- "summary": "Database pool, prepared query/execute helpers and transaction primitives.",
77
+ "summary": "Provider-neutral MySQL, PostgreSQL and SQLite query, transaction, lifecycle and migration primitives.",
77
78
  "guides": [
78
79
  "/docs/database",
79
80
  "/docs/database-migrations"
@@ -62,17 +62,27 @@ Related guide: [Caching](caching.md).
62
62
 
63
63
  ## `bcp/config`
64
64
 
65
- Typed configuration APIs.
65
+ Typed framework configuration, application environment-schema validation and diagnostics APIs.
66
66
 
67
67
  ```ts
68
68
  import {
69
+ applyEnvironmentDefaults,
69
70
  defineConfig,
71
+ defineEnvironment,
72
+ diagnoseBcpConfiguration,
73
+ getEnvironmentSchemaFileNames,
74
+ loadBcpEnvironmentSchema,
70
75
  readResolvedBcpConfig,
71
76
  resolveBcpConfig,
77
+ validateEnvironment,
72
78
  } from "bcp/config";
73
79
  ```
74
80
 
75
- Related guide: [Configuration](configuration.md).
81
+ Use `defineConfig()` for framework runtime/build settings and `defineEnvironment()` for the optional `bcp.environment.*` application-variable schema.
82
+
83
+ `validateEnvironment()` returns parsed declared values and structured issues. `applyEnvironmentDefaults()` fills only missing environment keys and does not overwrite values already supplied by the environment/runtime.
84
+
85
+ Related guides: [Configuration](configuration.md), [Environment Validation](environment-validation.md).
76
86
 
77
87
  ## `bcp/validation`
78
88
 
@@ -120,16 +130,35 @@ Related guide: [Error Handling](error-handling.md).
120
130
 
121
131
  ## `bcp/database`
122
132
 
123
- Server-only database primitives.
133
+ Server-only Database Platform v2 APIs.
124
134
 
125
135
  ```ts
126
136
  import {
127
137
  createDatabase,
128
138
  db,
139
+ resolveDatabaseOptions,
140
+ type DatabaseAdapter,
141
+ type DatabaseAdapterFactory,
142
+ type DatabaseConnectionOptions,
143
+ type DatabaseDriver,
144
+ type DatabaseOptions,
145
+ type DatabaseParameters,
146
+ type ResolvedDatabaseOptions,
147
+ type TransactionDatabase,
129
148
  } from "bcp/database";
130
149
  ```
131
150
 
132
- Use the public database helpers instead of importing framework-internal pool/runtime modules.
151
+ Built-in SQL providers are:
152
+
153
+ ```text
154
+ mysql
155
+ postgresql
156
+ sqlite
157
+ ```
158
+
159
+ `BcpDatabase` instances expose lazy query/execute/transaction operations plus explicit `connect()`, `disconnect()` and backward-compatible `close()` lifecycle methods.
160
+
161
+ Use the public database helpers and adapter types instead of importing framework-internal provider/pool runtime modules.
133
162
 
134
163
  Related guides: [Database](database.md), [Database Migrations](database-migrations.md).
135
164
 
@@ -92,6 +92,101 @@ BCP_EXPERIMENTAL_ISLANDS
92
92
 
93
93
  Application environment variables prefixed with `BCP_PUBLIC_` may be embedded into browser bundles. Other application variables remain server-side.
94
94
 
95
+ ## Configuration & Environment v2
96
+
97
+ BCP `0.2.2` adds an optional application environment schema in one of:
98
+
99
+ ```text
100
+ bcp.environment.ts
101
+ bcp.environment.mts
102
+ bcp.environment.js
103
+ bcp.environment.mjs
104
+ ```
105
+
106
+ The schema validates application-specific values after `.env` files are loaded.
107
+
108
+ Example:
109
+
110
+ ```ts
111
+ import {
112
+ defineEnvironment,
113
+ } from "bcp/config";
114
+
115
+ export default defineEnvironment({
116
+ DATABASE_URL: {
117
+ type: "string",
118
+ required: true,
119
+ },
120
+ SESSION_SECRET: {
121
+ type: "string",
122
+ required: true,
123
+ secret: true,
124
+ minLength: 32,
125
+ },
126
+ BCP_PUBLIC_API_URL: {
127
+ type: "url",
128
+ required: true,
129
+ },
130
+ });
131
+ ```
132
+
133
+ This schema is additive. Projects without `bcp.environment.*` continue to use the existing environment behavior.
134
+
135
+ Read more: [Environment Validation](environment-validation.md)
136
+
137
+ ## Configuration check
138
+
139
+ Validate the current project without starting the application:
140
+
141
+ ```bash
142
+ bcp config check
143
+ ```
144
+
145
+ JSON diagnostics:
146
+
147
+ ```bash
148
+ bcp config check --json
149
+ ```
150
+
151
+ Windows project-local form:
152
+
153
+ ```powershell
154
+ npm exec -- bcp-framework config check
155
+ ```
156
+
157
+ The check reports the selected config file, environment files, environment schema, resolved server/build settings and diagnostics. Raw environment values are not printed.
158
+
159
+ For production-mode warnings in PowerShell:
160
+
161
+ ```powershell
162
+ $env:NODE_ENV = "production"
163
+ npm exec -- bcp-framework config check
164
+ Remove-Item Env:NODE_ENV
165
+ ```
166
+
167
+ ## Startup diagnostics
168
+
169
+ `bcp dev` and `bcp build` run the environment-schema diagnostics before the application starts/builds.
170
+
171
+ Schema errors stop startup/build early. Production safety warnings do not fail the build by themselves.
172
+
173
+ Examples of production warnings include:
174
+
175
+ - source maps enabled,
176
+ - powered-by header enabled,
177
+ - Content-Security-Policy disabled,
178
+ - trusted proxy mode enabled.
179
+
180
+ Trusted proxy mode should only be enabled when untrusted clients cannot bypass the trusted proxy/load balancer.
181
+
95
182
  ## Config reload in development
96
183
 
97
- Changes to supported `.env*` files or `bcp.config.*` restart the development worker so the new resolved configuration is applied without restarting the parent CLI manually.
184
+ Changes to these configuration sources restart the development worker automatically:
185
+
186
+ ```text
187
+ .env*
188
+ bcp.config.*
189
+ bcp.environment.*
190
+ ```
191
+
192
+ The parent development supervisor stays running while the worker reloads the new configuration/environment state.
@@ -1,14 +1,33 @@
1
1
  # Database Migrations
2
2
 
3
- BCP Framework `0.1.15` adds MySQL migration commands to the `bcp` CLI.
3
+ BCP `0.2.3` extends framework-managed SQL migrations across MySQL, PostgreSQL and SQLite.
4
4
 
5
- ## Requirements
5
+ ## Supported providers
6
6
 
7
- Database migrations currently use the MySQL adapter from `bcp/database`.
7
+ Migration bookkeeping uses the same provider selection as `bcp/database`:
8
8
 
9
- Configure the same environment variables used by your application:
9
+ ```text
10
+ mysql
11
+ postgresql
12
+ sqlite
13
+ ```
14
+
15
+ Install the optional driver used by the application:
16
+
17
+ ```bash
18
+ npm install mysql2
19
+ npm install pg
20
+ npm install better-sqlite3
21
+ ```
22
+
23
+ Only one driver is required when the project uses one database provider.
24
+
25
+ ## Provider configuration
26
+
27
+ MySQL:
10
28
 
11
29
  ```env
30
+ DB_DRIVER=mysql
12
31
  DB_HOST=localhost
13
32
  DB_PORT=3306
14
33
  DB_USER=root
@@ -16,7 +35,20 @@ DB_PASSWORD=
16
35
  DB_NAME=bcp_app
17
36
  ```
18
37
 
19
- A project using migrations must have `mysql2` installed. Applications created with the MySQL preset already include it.
38
+ PostgreSQL:
39
+
40
+ ```env
41
+ DATABASE_URL=postgresql://postgres:password@localhost:5432/bcp_app
42
+ ```
43
+
44
+ SQLite:
45
+
46
+ ```env
47
+ DB_DRIVER=sqlite
48
+ DATABASE_URL=./data/bcp.sqlite
49
+ ```
50
+
51
+ Database commands load the development environment before connecting, so migration commands and `bcp dev` use the same provider selection.
20
52
 
21
53
  ## Create a migration
22
54
 
@@ -24,14 +56,14 @@ A project using migrations must have `mysql2` installed. Applications created wi
24
56
  bcp db create create_users
25
57
  ```
26
58
 
27
- BCP creates an ordered TypeScript file in `migrations/`:
59
+ BCP creates an ordered TypeScript file:
28
60
 
29
61
  ```text
30
62
  migrations/
31
- 20260827040506_create_users.ts
63
+ 20260829090000_create_users.ts
32
64
  ```
33
65
 
34
- A generated migration exports `up()` and `down()`:
66
+ Generated migrations export `up()` and `down()`:
35
67
 
36
68
  ```ts
37
69
  import type {
@@ -43,9 +75,9 @@ export async function up(
43
75
  ): Promise<void> {
44
76
  await db.execute(`
45
77
  CREATE TABLE users (
46
- id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
78
+ id INTEGER PRIMARY KEY,
47
79
  email VARCHAR(255) NOT NULL UNIQUE
48
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
80
+ )
49
81
  `);
50
82
  }
51
83
 
@@ -58,7 +90,24 @@ export async function down(
58
90
  }
59
91
  ```
60
92
 
61
- Migration filenames use a UTC timestamp prefix so migrations have a stable execution order.
93
+ Migration filenames use a UTC timestamp prefix for stable execution order.
94
+
95
+ ## SQL dialect responsibility
96
+
97
+ BCP keeps its own `_bcp_migrations` bookkeeping provider-aware, but it does not translate application migration SQL.
98
+
99
+ This means migrations should either:
100
+
101
+ - use SQL supported by every database target used by the application, or
102
+ - intentionally target one provider and use that provider's SQL syntax.
103
+
104
+ Parameter placeholders also follow the active provider:
105
+
106
+ ```text
107
+ MySQL ?
108
+ SQLite ?
109
+ PostgreSQL $1, $2, ...
110
+ ```
62
111
 
63
112
  ## Run pending migrations
64
113
 
@@ -66,9 +115,15 @@ Migration filenames use a UTC timestamp prefix so migrations have a stable execu
66
115
  bcp db migrate
67
116
  ```
68
117
 
69
- BCP creates the internal `_bcp_migrations` table when needed, detects files that have not been applied, and runs all pending migrations in filename order.
118
+ BCP creates `_bcp_migrations` with provider-specific DDL, detects pending migration files, and executes them in filename order.
119
+
120
+ All migrations applied by one command share the same batch number. Each migration runs inside its own transaction and its bookkeeping record is written in that same transaction.
70
121
 
71
- All migrations applied by one `bcp db migrate` command share the same batch number. Each individual migration runs inside its own database transaction. The migration record is inserted in the same transaction as `up()`.
122
+ Provider-specific bookkeeping includes:
123
+
124
+ - MySQL `AUTO_INCREMENT`,
125
+ - PostgreSQL `BIGSERIAL`,
126
+ - SQLite `INTEGER PRIMARY KEY AUTOINCREMENT`.
72
127
 
73
128
  ## Check status
74
129
 
@@ -84,22 +139,27 @@ The command reports applied and pending migration files together with the batch
84
139
  bcp db rollback
85
140
  ```
86
141
 
87
- Rollback reverses only the latest migration batch. Migrations in that batch run from newest to oldest, and each `down()` runs in a transaction together with removal of its migration record.
142
+ Rollback reverses only the latest migration batch. Migrations run from newest to oldest and each `down()` executes in a transaction together with deletion of its migration record.
88
143
 
89
144
  BCP refuses to roll back an applied migration when its migration file is missing.
90
145
 
91
146
  ## Project root
92
147
 
93
- All database commands support the normal BCP project-root option:
148
+ All database commands support the normal project-root option:
94
149
 
95
150
  ```bash
96
151
  bcp db status --root ./apps/admin
97
152
  ```
98
153
 
99
- ## Environment files
154
+ ## Database Platform v2 behavior
100
155
 
101
- Database commands load the BCP development environment files before connecting, so the same local database settings used by `bcp dev` can be reused by migration commands.
156
+ `0.2.3` keeps migration commands consistent across the built-in SQL providers:
102
157
 
103
- ## Current scope
158
+ ```text
159
+ bcp db create
160
+ bcp db migrate
161
+ bcp db status
162
+ bcp db rollback
163
+ ```
104
164
 
105
- `0.1.15` migration execution supports MySQL. PostgreSQL, SQLite and MongoDB presets remain available to `create-bcp-app`, but framework-managed migrations for those adapters are planned for later releases.
165
+ The command names and migration file contract stay the same regardless of whether the application uses MySQL, PostgreSQL or SQLite.